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

New focus handling behaviour #8250

Open
pskelin opened this issue Feb 7, 2024 · 2 comments
Open

New focus handling behaviour #8250

pskelin opened this issue Feb 7, 2024 · 2 comments

Comments

@pskelin
Copy link
Contributor

pskelin commented Feb 7, 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.

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
Copy link
Contributor

hristop commented Feb 20, 2024

Internal BLI created: BGSOFUIRILA-3812

@dobrinyonkov
Copy link
Contributor

Internal Reference: BGSOFUIPIRIN-6469

@petyabegovska petyabegovska moved this to In Progress in Planning - Topic P Jun 21, 2024
@petyabegovska petyabegovska moved this to In Progress in Planning - Topic RD Jun 21, 2024
@petyabegovska petyabegovska moved this to Approved in Planning - Topic RL Jun 21, 2024
@dobrinyonkov dobrinyonkov moved this from In Progress to Completed in Planning - Topic P Jul 4, 2024
@DMihaylova DMihaylova moved this from In Progress to Completed in Planning - Topic B Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Completed
Status: Completed
Status: In Progress
Status: Approved
Development

No branches or pull requests

4 participants