-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LEAF 4139 update keypress listeners in orgchartForm #2235
LEAF 4139 update keypress listeners in orgchartForm #2235
Conversation
LEAF_Nexus/js/orgchartForm.js
Outdated
event | ||
) { | ||
if (event.which == 13) { | ||
$("#" + dialog.btnSaveID).trigger("click"); | ||
setTimeout(() => { //timeout needed for ind 2 chosen dropdown |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what else might need to be reworked, but timeouts should not be used as they are less deterministic than typical event handlers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found another (and I agree better) solution to this which should result in the behavior being what it had been previously. If the chosen dropbox is open, the first 'enter' will just close it.
I had looked at the orgchart indicator formats and the position case looked like the only one that had a field with a dropdown - if this is not true I can also add this elsewhere.
This updates the .keypress listeners in the Nexus orgchartForm js file to .on("keydown" listeners.
This should restore enter-save functionality of Nexus employee, position and group modals. These were not changed in the recent update but seem to have been impacted by the addition of a dialogController modal keydown listener.
The deprecated/removed jQuery size() method was also replaced by the .length property to fix a separate uncovered error.
Impact/Testing
Nexus side, editable (check write access) position, group and employee fields should save when enter is pressed in orgForm modals. Confirm that these fields consistently save correctly (particularly the Position 'Pay Plan' field, which required a short timeout for the chosen dropdown).
Confirm that updating a position Total Headcount field does not result in an error.