Page MenuHomePhabricator

[web] Escape focus trap when an outside node is clicked
ClosedPublic

Authored by rohan on Jun 1 2023, 9:15 AM.
Tags
None
Referenced Files
F3488398: D8053.diff
Wed, Dec 18, 9:55 AM
Unknown Object (File)
Fri, Nov 22, 10:53 AM
Unknown Object (File)
Thu, Nov 21, 8:45 AM
Unknown Object (File)
Tue, Nov 19, 6:54 AM
Unknown Object (File)
Tue, Nov 19, 6:54 AM
Unknown Object (File)
Tue, Nov 19, 6:53 AM
Unknown Object (File)
Tue, Nov 19, 6:53 AM
Unknown Object (File)
Nov 17 2024, 10:27 AM
Subscribers

Details

Summary

All of the context and investigation is in ENG-3954, but encompassing ModalOverlay in a focus-trap
was blocking all tooltip actions, since it was not contained within the trapped DOM element.

There were a few solutions proposed, this one is just the simplest. There are two configurable options that can be passed into the component,
clickOutsideDeactivates and allowOutsideClick. Both seem to resolve the issue, but I opted for allowOutsideClick as instead of entirely deactivating the focus-trap and letting outside clicks to continue, it
just filters through the click and allows outside actions.

Test Plan

Please see the video below showing the solution

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

rohan requested review of this revision.Jun 1 2023, 9:34 AM

Makes sense to me, but would be great to get @kuba to take a look and test it to make sure it doesn't break the edit message use case focus-trap was introduced to handle!

This revision is now accepted and ready to land.Jun 2 2023, 2:50 AM