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

[Topic P][Feature Request]: New focus handling behaviour #8320

Closed
1 task done
ilhan007 opened this issue Feb 21, 2024 · 2 comments
Closed
1 task done

[Topic P][Feature Request]: New focus handling behaviour #8320

ilhan007 opened this issue Feb 21, 2024 · 2 comments

Comments

@ilhan007
Copy link
Member

ilhan007 commented Feb 21, 2024

Feature Request Description

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

  • on desktop, always show a focus outline, no matter if the focus was received via mouse or keyboard
  • on mobile, show focus outline only when focus is received via external keyboard and never show focus when the element is receiving focus via touch.

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

To be clarified:

  • Select receives focus via keyboard on mobile, has an outline and can be opened with enter. The same is not the case for MultiCombobx and will be tacked separately.

Example implementation

#8253

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.

Proposed Alternatives

No response

Organization

UI5

Additional Context

No response

Priority

None

Privacy Policy

  • I’m not disclosing any internal or sensitive information.
@ilhan007
Copy link
Member Author

Related to: #8250

@nnaydenow nnaydenow added this to New in Planning - Topic P via automation Mar 7, 2024
kgogov added a commit that referenced this issue Apr 8, 2024
Adjusted ui5-checkbox focus display rules. On desktop, focus outline is
always visible. For mobile, focus outline only appears with an external
keyboard, it remains hidden for touch focus.

Related to: #8320
kgogov added a commit that referenced this issue Apr 15, 2024
Adjusted ui5-avatar-group focus display rules. On desktop, focus outline
is always visible. For mobile, focus outline only appears with an
external keyboard, it remains hidden for touch focus.

Related to: #8320
kgogov added a commit that referenced this issue Apr 16, 2024
Adjusted `ui5-icon` focus display rules. On desktop, focus outline is
always visible. For mobile, focus outline only appears with an external
keyboard, it remains hidden for touch focus.

Related to: #8320
@dobrinyonkov dobrinyonkov moved this from New to In Progress in Planning - Topic P Apr 16, 2024
@dobrinyonkov
Copy link
Contributor

Internal Reference: BGSOFUIPIRIN-6469

@dobrinyonkov dobrinyonkov added this to the 2.0.0 milestone Apr 16, 2024
kgogov added a commit that referenced this issue Apr 23, 2024
Adjusted `ui5-media-gallery` focus display rules. On desktop, focus
outline is always visible. For mobile, focus outline only appears with
an external keyboard, it remains hidden for touch focus.

Related to: #8320
kgogov added a commit that referenced this issue Apr 24, 2024
Adjusted `ui5-shellbar` focus display rules. On desktop, focus
outline is always visible. For mobile, focus outline only appears with
an external keyboard, it remains hidden for touch focus.

Related to: #8320
kgogov added a commit that referenced this issue May 10, 2024
Adjusted `ui5-product-switch-item` focus display rules. On desktop,
focus outline is always visible. For mobile, focus outline only appears
with an external keyboard, it remains hidden for touch focus.

Related to: #8320
kgogov added a commit that referenced this issue May 28, 2024
Adjusted ui5-list and other derivatives list items focus display rules.
On desktop, focus outline is always visible. For mobile, focus outline
only appears with an external keyboard, it remains hidden for touch
focus.

Related to: #8320, #7858
kgogov added a commit that referenced this issue May 29, 2024
Adjusted ui5-list and other derivatives list items focus display rules.
On desktop, focus outline is always visible. For mobile, focus outline
only appears with an external keyboard, it remains hidden for touch
focus.

Related to: #8320, #7858

---------

Co-authored-by: Teodor Taushanov <teodor.taushanov@sap.com>
@kgogov kgogov moved this from In Progress to Completed in Planning - Topic P May 30, 2024
@kgogov kgogov closed this as completed May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Completed
Development

No branches or pull requests

4 participants