Skip to content

Conversation

ilhan007
Copy link
Member

@ilhan007 ilhan007 commented Aug 28, 2025

The isElementHidden method called internally by getFirstFocusableElement returns true on Safari for the ui5-form-item, considering the element as hidden, skipping the traverse of its children. This happens, because el.offsetHight and offsetWidth for the host custom element (ui5-form-item custom element in the specific issue) are 0 on Safari.

This probably happens for other components - Safari's layout engine doesn't always calculate dimensions correctly for the host element when content is in shadow DOM.

Solution - add display to the host element:

:host(:not([hidden])) {
	display: block;
	width: 100%;
}

Fixes: #12201

@ilhan007 ilhan007 requested a review from nnaydenow August 28, 2025 08:01
@ilhan007 ilhan007 closed this Aug 29, 2025
@ilhan007 ilhan007 reopened this Aug 29, 2025
@ilhan007 ilhan007 changed the title fix(framework): fix getFirstFocusableElementon Safari fix(ui5-form-item): update host element display Aug 29, 2025
@ilhan007 ilhan007 merged commit bd9299e into main Aug 29, 2025
12 checks passed
@ilhan007 ilhan007 deleted the fix-focusable-elements-safari branch August 29, 2025 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

getFirstFocusableElement utility does not work as expected in Safari with form
2 participants