This repository was archived by the owner on Jan 22, 2026. It is now read-only.
Merged
Conversation
added 2 commits
November 4, 2019 10:02
clottman
approved these changes
Nov 4, 2019
Contributor
|
🚀 PR was released in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently when you open a popover and click anywhere else, your focus returns back to the popover button that opened it. This was done purposely to ensure users do not lose focus when they press escape. But it looks like we've accidentally created other focus bugs by accident. Now if you click to open a popover and then click on any other interactive element your focus does not go to that interactive element but back to the old popover to show you closed it. This means if you're clicking around between popovers or between input fields it's pretty easy to get confused. Here's a screen recording illustrating what I'm talking about: https://recordit.co/0e7KhdW4Mf
My first thought was to remove this functionality entirely, but I realized when you tab into a popover and then press escape you lose your focused element. So now I'm suggesting that in general we don't steal back focus except if you use escape to close in which case grab back focus to the button that opens the popover.
To play around with this you can use:
https://fluff-hollyhock.glitch.me/#StoryPopover
or you can use
https://glass-mercury.glitch.me/
which should have the changed Popover component running, it might be helpful to see the git diff here:
https://github.com/FogCreek/Glitch-Community/pull/1046/files
I tried to mock out all the Popovers in that remix, but I probably missed a few, irl we won't need to change the community code at all.
Shoutout to Cassey (and Greg!) for pairing on this!