-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
fix: Don't close popovers on scroll #7541
base: main
Are you sure you want to change the base?
Conversation
} | ||
|
||
describe('usePopover', () => { | ||
it('should not add scroll listener', () => { |
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.
Thanks so much for the PR.
This test is very much about the implementation details. Could we make it more about how a user would interact with it and come across this in real life? That way if we change how this is implemented down the line, we won't break the test and we'll know we haven't broken the intended behavior.
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.
Yes, I agree completely. As mentioned in the description, I struggled with finding something appropriate to assert on here. I will take another look and see if I can come up with something better
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.
Okay, I think I've landed on something more robust this time around
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.
Thanks for this!
Closes #7516.
This addresses a regression introduced in #7368 within the
usePopover
hook✅ Pull Request Checklist:
📝 Test Instructions:
I've added a new Jest test for this
🧢 Your Project: