Skip to content
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

Merged
merged 4 commits into from
Jan 7, 2021
Merged

fix(ui5-popup): correct focus when there is no focusable content #2583

merged 4 commits into from
Jan 7, 2021

Conversation

dimovpetar
Copy link
Contributor

@dimovpetar dimovpetar commented Dec 16, 2020

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

When there is no focusable content, the focus should be on the root of the component.

Fixes #2556
@CLAassistant
Copy link

CLAassistant commented Dec 16, 2020

CLA assistant check
All committers have signed the CLA.

vladitasev
vladitasev previously approved these changes Jan 7, 2021
@@ -6,6 +6,8 @@
aria-label="{{_ariaLabel}}"
aria-labelledby="{{_ariaLabelledBy}}"
dir="{{dir}}"
tabindex="-1"
@keydown={{_onRootFocusOut}}
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@dimovpetar dimovpetar dismissed stale reviews from vladitasev and TeodorTaushanov via a5db06b January 7, 2021 14:37
@vladitasev vladitasev merged commit bf8caaf into SAP:master Jan 7, 2021
@dimovpetar dimovpetar deleted the fix_popup_focus branch January 7, 2021 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ui5-popover: wrong position after open
4 participants