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
DateTimePicker: fix onChange callback check so that it also works inside iframes #54669
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.
Working well! ownerDocument.defaultView
is good use
All input changes fire correct data on both Storybook and Editor
Editor | Storybook |
---|---|
Kapture.2023-09-20.at.22.48.24.mp4 |
Kapture.2023-09-20.at.22.51.34.mp4 |
Flaky tests detected in b551a18. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6250831673
|
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.
This works well for me 👍
✅ Could replicate original issue on trunk
✅ This PR correctly fires onChange callback for all inputs when inside an iframe
✅ Tested well in the editor and the Storybook
Nice work @ciampo!
…ide iframes (#54669) * DateTimePicker: fix onChange callback check so that it also works inside iframes * CHANGELOG
I just cherry-picked this PR to the release/16.7 branch to get it included in the next release: e38d246 |
What?
Fixes #54378
Inspired by #54643
Improve internal check in
DateTimePicker
so that theonChange
callback fires even when the picker is rendered inside an iframe.Why?
Making the component more robust by not assuming (in the
instanceof
check) that it always going to be rendered in the root window.How?
By grabbing the
HTMLInputElement
value from the event target's owner window.Testing Instructions
Click to expand