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

Focus on the close button of keyboard help screen #4479

Merged

Conversation

compulim
Copy link
Contributor

@compulim compulim commented Oct 29, 2022

Fixes #4476. Fixes #4442.
Fixes PVA #15582721.

Changelog Entry

Fixed

  • Fixes #4476. When focus on the keyboard help screen, it should focus on the close button, by @compulim in PR #4479
  • Fixes #4442. Change the keyboard help screen string "Leave message" to "Exit message", by @compulim in PR #4479

Description

When TAB into Web Chat, it will show the keyboard help screen.

The focus should be on the close button of the keyboard help screen, instead of on the role="dialog" itself.

Also updated one of the strings in the keyboard help screen.

Design

Specific Changes

  • role="dialog": remove tabIndex="0" so it will no longer be tabbable
  • Close button: remove tabIndex="-1" so it will be tabbable
  • Close button: added CSS outline: 0 as we already styled a focus ring
  • Moved some event handlers from role="dialog" to the close button
  • Localization: keyboard help screen string change to "Exit message" from "Leave message"
  • Added tests
  • Transpile bent into ES5 as it currently broke IE11, bent is used by Cognitive Services Speech SDK
  • IE11: Added focusable={false} to <svg>
    • IE11 defaults SVG to be tabbable and tabIndex={-1} don't work
    • Today, it took a few extra TAB to get past the keyboard help screen, because a few TAB lands on SVGs
  • 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)

@compulim compulim added this to the release-4.15.5 milestone Oct 29, 2022
@compulim compulim marked this pull request as ready for review October 29, 2022 21:57
@compulim compulim merged commit b544650 into microsoft:main Nov 15, 2022
@compulim compulim deleted the fix-4476-keyboard-help-focus-close-button branch November 15, 2022 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants