SAP / ui5-webcomponents

UI5 Web Components - the enterprise-flavored sugar on top of native APIs! Build SAP Fiori user interfaces with the technology of your choice.
https://sap.github.io/ui5-webcomponents/
Apache License 2.0
1.53k stars 265 forks source link

New focus handling behaviour #8250

Open pskelin opened 8 months ago

pskelin commented 8 months ago

Feature Request Description

According to the latest visual and interaction designs, the focus should behave like this:

Input elements remain unchanged - they always show focus as additional attention is needed.

To be clarified:

Proposed Solution

A pure CSS solution is possible by using :focus-visible which will match only when focus is received via keyboard. This is sufficient for mobile.

For desktop, the :focusselector should be used with an additional attribute on the host manually set by the component. Use :focus-within if a nested component can receive focus, such as a button with avatar, the avatar will get the focus when touched.

The manual attributes [focused] and setting them via focusin and focusout handlers is discouraged and should be clarified additionally.

Example implementation

8253

hristop commented 8 months ago

Internal BLI created: BGSOFUIRILA-3812

dobrinyonkov commented 8 months ago

Internal Reference: BGSOFUIPIRIN-6469