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

[FocusTrapZone]: Fix text selection within FocusTrapZone #3759

Merged
merged 2 commits into from
Jan 22, 2018

Conversation

jakob101
Copy link
Member

Pull request checklist

  • Addresses an existing issue: Fixes a bug where text selection inside FocusTrapZone was impossible
  • Include a change request file using $ npm run change

Description of changes

The forced focus on the root element of FocusTrapZone makes it impossible to select text inside the FocusTrapZone as you can see in this CodePen Try selecting text inside the FocusTrapZone.

Then try removing the call to _onRootFocus in the DevTools.

Focus areas to test

(optional)

@jakob101 jakob101 changed the title Jawerne/focus trap zone [FocusTrapZone]: Fix text selection within FocusTrapZone Jan 22, 2018
@jakob101
Copy link
Member Author

@chaofeng2014 if I make it focusable (tabindex=-1), it gets the blue outline on selection, which makes me use CSS in the focusTrapZone (to make the blue outline disappear until is-focusVisible). That sounded worse to me so I didn't do it. But I'm happy to do that if you think otherwise :)

@jakob101
Copy link
Member Author

So basically I reverted a small part of the change #3489 (which made focusTrapZone selectable).

@dzearing dzearing merged commit 8fcd40a into microsoft:master Jan 22, 2018
@jakob101 jakob101 deleted the jawerne/focusTrapZone branch January 22, 2018 18:18
chrismohr pushed a commit to chrismohr/office-ui-fabric-react that referenced this pull request Apr 17, 2018
)

* Enabling back text selection inside focusTrapZone

* Changefile
@microsoft microsoft locked as resolved and limited conversation to collaborators Aug 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants