-
Notifications
You must be signed in to change notification settings - Fork 5k
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
[Modal] Fix #6198 - added check whether focused element is in a viewport #6281
base: next
Are you sure you want to change the base?
Conversation
I believe there is no need to restore focus to the invisible element.
I think this should be optional since some people might want to go back to the focused element. |
This PR doesn't disable going to the focused element if it is visible. But if you want add a general flag to return or not to return to the invisible element - still good for me. |
Ye, I think it should be an option so it doesn't change any existing behaviour. |
If I add new setting to the $.fn.modal.settings.focusInvisible = false; and for the specific modal window with: $('.ui.modal').modal({
focusInvisible: false,
}); ? |
From my knowledge the settings which are passed when calling the module override the global settings which are defined at the end of the file so yes if you do $.fn.modal.settings.focusInvisible = false; $('.ui.modal').modal({
focusInvisible: true
}); The modal with |
Thanks for the idea, I've added needed changes. Now it is optional and enabled by default. |
Hello! Can somebody merge this PR? |
I believe there is no need to restore focus to the invisible element when modal window is closed. Then there won't be cases like #6198