-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Use data-wp-on-async directives in core blocks when handler does not need synchronous access to event #62160
Conversation
…s access to event
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress. If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged. If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack. Thank you! ❤️ View changed files❔ packages/block-library/src/navigation/index.php ❔ packages/block-library/src/query-pagination-next/index.php ❔ packages/block-library/src/query-pagination-previous/index.php ❔ packages/block-library/src/search/index.php ❔ phpunit/blocks/render-query-test.php |
Size Change: 0 B Total Size: 1.74 MB ℹ️ View Unchanged
|
Flaky tests detected in da7f0a8. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/9311111372
|
…dd/on-async-directives * 'trunk' of https://github.com/WordPress/gutenberg: (72 commits) Top toolbar: fix half a pixel artifacting of the bottom border. (#62225) Fix UI order for theme.json spacing sizes (#62199) Chore: Simplify a padding style on global styles. (#62291) Editor: Avoid remounts of `DocumentBar` (#62214) Add `default-spacing-sizes` and `default-font-sizes` options for classic themes (#62252) Editor: Cleanup styles and classnames (#62237) Scripts: Pin the @wordpress/scripts version to a version supported by WP 6.5 (#62234) Documentation: Better changelogs for the JSX transform upgrade (#62265) Chore: Simplify a padding style on dataviews. (#62276) MediaUpload: Remove dialog markup on close (#62168) Tabs: Prevent accidental overflow in indicator (#61979) Make edit site pagination buttons accessibly disabled. (#62267) Fix: Remove unused code from dataviews styles. (#62275) Re-enable React StrictMode (#61943) Inserter: Return the same items when the state and parameters don't change (#62263) Update instances of text-wrap: pretty to fall back to balance (#62233) Update: Slotfill documentation samples (links, code, and rephrase). (#62271) Try: Fix mover positioning. (#62226) [Mobile] - Image corrector - Check the path extension is a valid one (#62190) Update: Block styles documentation. ...
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 updating it!
Tested and works as expected.
Should this be backported for WP 6.6? If so, please add the |
…need synchronous access to event (#62160) * Use data-wp-on-async directives when handler does not need synchronous access to event * Fix unit tests Co-authored-by: westonruter <[email protected]> Co-authored-by: cbravobernal <[email protected]>
…need synchronous access to event (#62160) * Use data-wp-on-async directives when handler does not need synchronous access to event * Fix unit tests Co-authored-by: westonruter <[email protected]> Co-authored-by: cbravobernal <[email protected]>
…need synchronous access to event (WordPress#62160) * Use data-wp-on-async directives when handler does not need synchronous access to event * Fix unit tests Co-authored-by: westonruter <[email protected]> Co-authored-by: cbravobernal <[email protected]>
This was cherry-picked to the wp/6.6 branch. |
This is a follow-up to #61885 for #61634 which introduced
data-wp-async-on--[event]
and implemented it for the Image block. This PR leverages it for the other core blocks where appropriate. Namely,data-wp-on-async--[event]
can be used instead ofdata-wp-on--[event]
whenever the handler does not take an Event object or if the handler doesn't need to callpreventDefault()
,stopPropagation
orstopImmediatePropagation()
which are the synchronous APIs on the Event object.