-
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
wip(framework): fix find first focusable element #10984
base: main
Are you sure you want to change the base?
Conversation
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.
Also add dedicated tests, maybe in new file FocusableElements.cy.tsx
@@ -36,6 +36,17 @@ const isElemFocusable = (el: HTMLElement) => { | |||
return el.hasAttribute("data-ui5-focus-redirect") || !isElementHidden(el); | |||
}; | |||
|
|||
const isUI5ElementWithNegativeTabIndex = (el: HTMLElement) => { |
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.
why do we need this?
const isUI5ElementWithNegativeTabIndex = (el: HTMLElement) => { | ||
if (instanceOfUI5Element(el)) { | ||
const tabIndex = el.getAttribute("tabindex"); | ||
if (tabIndex !== null && tabIndex !== undefined && parseInt(tabIndex) < 0) { |
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.
getAttribute returns null or string. check with undefined is redundant
fixes #10965