-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[Popover] Revert to type assertion to handle SVGElements #2827
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
Worth adding a regression test? |
Regression tests added, please let me know if something else is missing. |
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 great and confirmed the test fails when running against master
0faf534
to
c51dc76
Compare
@attila-berki @tmlayton this doesn't seem to be fixed. clear button on TextField still makes the popover close |
Do you have an example or a branch I could checkout? |
Hey @Macs91 👋 It looks to me that this is not related to the SVGElement type check, if you remove the clear button click handler the Popover remains open. I would suggest to check the click handler implementation of the clear button and compare it to the click handler of the increment / decrement arrows. |
* Revert to type assertion to handle SVGElements * Add regression tests Co-authored-by: Tim Layton <tim.layton@shopify.com>
Replacing type assertion with type check introduced a small issue in case of the
<PopoverOverlay />
click handler.If the target element is an SVGElement the descendent check is not even invoked and the Popover get's closed similarly when you click outside of it.
Reported issue:
https://github.com/Shopify/web/issues/24540
Partially reverting changes from #2638
WHY are these changes introduced?
WHAT is this pull request doing?
How to 🎩
🖥 Local development instructions
🗒 General tophatting guidelines
📄 Changelog guidelines
Copy-paste this code in
playground/Playground.tsx
:🎩 checklist
README.md
with documentation changes