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

BasicTranscript: improve focus display #5145

Merged
merged 4 commits into from
Apr 25, 2024
Merged

Conversation

OEvgeny
Copy link
Collaborator

@OEvgeny OEvgeny commented Apr 25, 2024

Fixes #

Changelog Entry

Fixed

  • Fixes #5146. Fixed chat history focus indicator should not show up on tap, by @OEvgeny, in PR #5145

Description

Use the focus-visible selector, so browser can use built-in heuristics to determine if they should display the focus ring or not.

Design

We intentionally do not specify the :focus selector letting older browser to use native styles. This should work out as the most browsers support the :focus-visible selector:
image

Specific Changes

  • Modified StyleSet/BasicTranscript.tsx to use :focus-visible instead of :focus to show the focus indicator
  • I have added tests and executed them locally
  • I have updated CHANGELOG.md
  • I have updated documentation

Review Checklist

This section is for contributors to review your work.

  • Accessibility reviewed (tab order, content readability, alt text, color contrast)
  • Browser and platform compatibilities reviewed
  • CSS styles reviewed (minimal rules, no z-index)
  • Documents reviewed (docs, samples, live demo)
  • Internationalization reviewed (strings, unit formatting)
  • package.json and package-lock.json reviewed
  • Security reviewed (no data URIs, check for nonce leak)
  • Tests reviewed (coverage, legitimacy)

@OEvgeny
Copy link
Collaborator Author

OEvgeny commented Apr 25, 2024

I intentionally left :focus pseudo-class at the line 103 as it serves the different purpose of hiding content when focus present, and should work regardless focus-visible support.

@OEvgeny OEvgeny marked this pull request as ready for review April 25, 2024 20:30
@compulim compulim enabled auto-merge (squash) April 25, 2024 21:36
@compulim compulim merged commit edca85d into main Apr 25, 2024
25 checks passed
@compulim compulim deleted the feature/better-transcript-focus branch April 25, 2024 21:50
This was referenced Sep 16, 2024
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.

Only show chat history focus when using a keyboard but not mouse
2 participants