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

fix(Tooltip): add focus trap behavior and fix focus management logic #6458

Conversation

emyarod
Copy link
Member

@emyarod emyarod commented Jul 13, 2020

Closes #6443
Refs #1264 (comment)
Refs #4414
Refs #5489

This PR implements optional focus trapping in the interactive tooltip and correctly places focus back on the trigger element after the tooltip is dismissed.

Changelog

Changed

  • enable focus trap option in interactive tooltip
  • place focus back on tooltip trigger element after tooltip dismissal rather than around elements where the tooltip portal is created/destroyed
  • rename wrapFocus props to be more generic

Testing / Reviewing

Confirm that focus and blur behaves as expected within the interactive tooltip component as well as between interactive siblings to the tooltip. Ensure that focus management remains the same in other wrapFocus or FloatingMenu components like Modal, ComposedModal, and OverflowMenu

@emyarod emyarod requested a review from a team as a code owner July 13, 2020 22:57
@ghost ghost requested review from aledavila and tw15egan July 13, 2020 22:58
@emyarod emyarod force-pushed the 6443-interactive-tooltip-focus-behavior branch from 3957aa7 to 62a5688 Compare July 13, 2020 22:58
@netlify
Copy link

netlify bot commented Jul 13, 2020

Deploy preview for carbon-elements ready!

Built with commit 3957aa7

https://deploy-preview-6458--carbon-elements.netlify.app

@netlify
Copy link

netlify bot commented Jul 13, 2020

Deploy preview for carbon-elements ready!

Built with commit cd2d3a7

https://deploy-preview-6458--carbon-elements.netlify.app

@netlify
Copy link

netlify bot commented Jul 13, 2020

Deploy preview for carbon-components-react ready!

Built with commit 3957aa7

https://deploy-preview-6458--carbon-components-react.netlify.app

@netlify
Copy link

netlify bot commented Jul 13, 2020

Deploy preview for carbon-components-react ready!

Built with commit cd2d3a7

https://deploy-preview-6458--carbon-components-react.netlify.app

Copy link
Member

@tw15egan tw15egan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Focus working as expected 👍 ✅

@emyarod emyarod force-pushed the 6443-interactive-tooltip-focus-behavior branch from 5d153a5 to cd2d3a7 Compare July 22, 2020 16:54
@kodiakhq kodiakhq bot merged commit 2f2e17d into carbon-design-system:master Jul 22, 2020
@emyarod emyarod deleted the 6443-interactive-tooltip-focus-behavior branch July 22, 2020 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Tooltip]: focus lost after tabbing away from button in tooltip
3 participants