-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Fixes issues where input was being refocused when the window is blurred and refocused #212
Merged
Conversation
This file contains 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
majapw
added
the
semver-patch: fixes/refactors/etc
Anything that's not major or minor.
label
Dec 13, 2016
ljharb
approved these changes
Dec 13, 2016
Nice! Good fix 👍 |
backwardok
approved these changes
Dec 13, 2016
majapw
force-pushed
the
maja-fix-weird-refocus-issue
branch
from
December 13, 2016 23:01
ca926b0
to
1a0d030
Compare
majapw
force-pushed
the
maja-fix-weird-refocus-issue
branch
from
December 13, 2016 23:02
1a0d030
to
9e6e89b
Compare
Changes Unknown when pulling 9e6e89b on maja-fix-weird-refocus-issue into ** on master**. |
glad to see this merged @majapw, thank you! will you be making a release soon? or should I pull from master? |
Doing a release as we speak! |
so much awesome |
v4.1.1 is live! :) |
This was referenced Dec 14, 2016
Closed
Note that this caused #937 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fix for #120
So we've spent a bit of time digging around and the main issue is that when you leave the page and then return,
document.activeElement
is still the<input />
and so it triggers the focus listener. Our original instinct was just to blur theinput
when the window itself was blurred, we realized eventually that the real issue is that what is focused according to our react code is getting out of sync with what is focused according to the DOM.We already had some code that would focus and select the input if that's the way
props.focused
had changed... so now we've added some code that blurs the input ifprops.focused
had changed to false. This seems to solve #120 pretty completely (for both the SDP and the DRP).to: @ljharb @backwardok
cc: @jkudish @Valentin1918