-
Notifications
You must be signed in to change notification settings - Fork 1k
add a check to see if target is clicked #7300
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
Conversation
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.
I tested with the code you have in the PR description but I was still seeing the issue:
Aug-21-2024.14-09-21.mp4
updated sorry forgot to also check for |
Co-authored-by: Jessica Filben <54560994+jcfilben@users.noreply.github.com>
Co-authored-by: Jessica Filben <54560994+jcfilben@users.noreply.github.com>
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.
Looks good!
What does this PR do?
This PR checks to see if the user clicks on the target and then will not invoke the
onClickOutside
funcWhere should the reviewer start?
dropContainer
What testing has been done on this PR?
Added a test
local story
How should this be manually tested?
use the above code to test locally
Do Jest tests follow these best practices?
screen
is used for querying.asFragment()
is used for snapshot testing.Any background context you want to provide?
When you click on the target in which opens the drop if you have it set in your local state to close the drop this was not working properly when
onClickOutside
was presentsee codesandbox
https://codesandbox.io/p/sandbox/jovial-mopsa-4ry469?file=%2Fsrc%2Findex.js%3A28%2C1-28%2C52
What are the relevant issues?
Screenshots (if appropriate)
Do the grommet docs need to be updated?
no
Should this PR be mentioned in the release notes?
yes
Is this change backwards compatible or is it a breaking change?
backwards compatible