-
Notifications
You must be signed in to change notification settings - Fork 280
Description
Feature Request Description
It would be great if the focus() function could restore focus to the previously focused element, or apply it to the appropriate one, in components that use item navigation.
Since item navigation dynamically manages the tabindex of HTML elements within the component, implementing this behavior would significantly enhance usability.
Similar to the List control in OpenUI5, calling focus() should focus either the first item in the list or the last focused item, if one exists.
You can observe the behavior of the List control here: https://stackblitz.com/edit/vitejs-vite-tj5gsxzc?file=index.html
Expected behavior:
When focus() is called on a component with item navigation, it should correctly apply focus to the element that was previously focused.
Components that require attention:
- compat/Table
- MediaGallery - feat(ui5-breadcrumbs, ui5-meadia-gallery): getFocusDomRef added #11869
- ProductSwitch - feat(ui5-avatar-group, ui5-product-switch): getFocusDomRef added #11762
- SideNavigation
- Timeline
- Wizard- feat(ui5-wizard): add getFocusDomRef #12668
- AvatarGroup - feat(ui5-avatar-group, ui5-product-switch): getFocusDomRef added #11762
- Breadcrumbs - feat(ui5-breadcrumbs, ui5-meadia-gallery): getFocusDomRef added #11869
- CalendarLegend
- ColorPalette
- List - feat(ui5-list): focus() now focuses item #11486
- MenuItem
- SegmentedButton
- TabContainer
- Tokenizer
Proposed Solution
Implement getFocusDomRef as follows:
getFocusDomRef(): HTMLElement | undefined {
return this._itemNavigation._getCurrentItem();
}Proposed Alternatives
No response
Organization
SAP
Additional Context
No response
Priority
Low
Privacy Policy
- I’m not disclosing any internal or sensitive information.
Metadata
Metadata
Assignees
Type
Projects
Status
Status
Status
Status
Status