Skip to content

[FocusTrapZone]: Fix text selection within FocusTrapZone#3759

Merged
dzearing merged 2 commits into
microsoft:masterfrom
jakob101:jawerne/focusTrapZone
Jan 22, 2018
Merged

[FocusTrapZone]: Fix text selection within FocusTrapZone#3759
dzearing merged 2 commits into
microsoft:masterfrom
jakob101:jawerne/focusTrapZone

Conversation

@jakob101

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@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