This repository was archived by the owner on Sep 6, 2021. It is now read-only.
Fix 7598: showModalDialogUsingTemplate doesn't blur current editor - #7677
Merged
Conversation
Contributor
|
You can't even expect a dialog to have one button. Most have, but some not. |
Contributor
There was a problem hiding this comment.
This will select a button in the modal-body if there's one. I believe only buttons in the fooder should be focussed.
Contributor
Author
There was a problem hiding this comment.
You are right. Nice catch!
Contributor
Author
|
I just got some time to fix this. It will now try to focus the primary button, then any other button in the footer and finally the actual dialog, which should now actually work for every dialog. |
Contributor
There was a problem hiding this comment.
We not try and set focus to the element with the lowest tabindex first?
Contributor
Author
There was a problem hiding this comment.
I am not sure how that will work. But maybe we can first focus any input.
Since every dialog has at least one button that is not disabled (to be able to close the dialog), this will set the focus on any other button when the primary one is disabled.