-
Notifications
You must be signed in to change notification settings - Fork 273
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
fix(ui5-popup): correct focus when there is no focusable content #2583
Conversation
When there is no focusable content, the focus should be on the root of the component. Fixes #2556
packages/main/src/Popup.hbs
Outdated
@@ -6,6 +6,8 @@ | |||
aria-label="{{_ariaLabel}}" | |||
aria-labelledby="{{_ariaLabelledBy}}" | |||
dir="{{dir}}" | |||
tabindex="-1" | |||
@keydown={{_onRootFocusOut}} |
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.
Please call this method _onkeydown
. For event handlers it is preferable to call the function based on what event is handled, instead of on what the function does. Later, if you need to implement some other kind of KH, it would have to be in the same method, as it is the one bound to the event, and then the name _onRootFocusOut
would no longer be entirely correct and then you would have to rename it to _onkeydown
or something similar, so better to do it now.
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.
Done
a5db06b
When there is no focusable content, the focus should be on the root of the component.
Fixes #2556
Thank you for your contribution! 👏
To get it merged faster, kindly review the checklist below:
Pull Request Checklist