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
Unify Flare FocusWithin responder with useFocusWithin #18636
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 1ddda57:
|
Details of bundled changes.Comparing: 71964c0...1ddda57 react-interactions
Size changes (experimental) |
Details of bundled changes.Comparing: 71964c0...1ddda57 react-interactions
Size changes (stable) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yikes these tests are complicated. I don't even remember what all the before/after stuff is for
@necolas The tests were adapted and taken from internal code for |
We have a focus hook that is testing itself against a different user space abstraction that has to be built up in the test. The complexity suggests the divisions might not be right because you can't be sure of the behavior without doing this |
I've removed the tests from this PR. |
I'm not saying whether or not the tests should be part of the PR :) Just that if these sorts of tests are needed to verify the behavior of this hook, then maybe we're missing something about where this functionality belongs |
@necolas They're not needed to verify the behavior at all, I just brought them in to verify I didn't make any mistakes, given they pass with it, and I don't anticipate making any more changes, it should be fine. Furthermore, I guess given that we plan on migrating these to FB soon, where they'll get the full test coverage of FocusRegion's tests, it makes sense to leave it till then and not bring them in right now. The sync would fail if we broke something anyway. |
This PR unifies the Flare
FocusWithin
responder with the recentuseFocusWithin
responder so the Flare version uses a fakeafterblur
rather the fakeblur
. This means we can easily A/B test the various implementations that rely on this internally. I've also added FocusRegion tests that confirm the functionality matches that as we expect internally too.