-
Notifications
You must be signed in to change notification settings - Fork 799
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
Search: Clicking outside overlay closes overlay #22690
Conversation
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped. Jetpack plugin:
|
6f8492a
to
b30dbef
Compare
…-search-overlay-on-outside-click
projects/packages/search/src/instant-search/components/overlay.jsx
Outdated
Show resolved
Hide resolved
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.
It works as described, good job 👍 One potential typo and suggested a change.
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 noticed when you open and close the overlay for several times, it causes the browser to hang. Profiled the process, it seems the click event is taking longer each time.
Possibly this is related - we should get the element dynamically instead of storing a static handle even it saves some calculations - the element could be destroyed and re-rendered which is causing objects not released?
Good catch. I'm not able to replicate, but it might have been caused by the |
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.
Good job it works perfectly and code looks good to me 👍
…-search-overlay-on-outside-click
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.
Works great for me 👍
Hi @jeherve, just wanted to make sure #22461 is working as expected. In this PR, we're making a minor enhancement to the Search package, resulting in a version bump. This version bump is then propagated to Jetpack's composer.json, which triggers the Although requiring Crew reviews for packages affecting the Jetpack plugin makes sense, it also means #22461 won't really be useful because any changes (major or minor |
Major or minor, but not patch as a patch bump would not result in a change the "0.8.x-dev" pseudo-version. Unfortunately the check works on the file level, so we can't specify that certain changes to Jetpack's |
Co-authored-by: Jasper Kang <jasper.kang@automattic.com>
Fixes #18937.
Changes proposed in this Pull Request:
Adds an event handler on the window checking for clicks outside the search overlay.
Does this pull request change what data or activity we track or use?
None.
Testing instructions:
e.g.
/?s=page`.