Fix: JQuery .proxy deprecated and QMIGRATE: Boolean attribute 'disabled' is not set to its lowercased name in Jquery 4.0 - #10661
Conversation
|
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 Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
8cb5a3b to
5f37571
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates WordPress Media UI button disabling logic to align with jQuery 4.x boolean attribute behavior by using .prop( 'disabled', ... ) instead of .attr( 'disabled', ... ), preventing boolean-attribute migration warnings and ensuring correct disabled state handling on <button> elements.
Changes:
- Switch
wp.media.view.Buttonrendering to setdisabledvia.prop()instead of.attr(). - Switch the cropper toolbar “Insert/Crop” button to disable via
.prop()instead of.attr().
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/js/media/views/button.js | Uses .prop( 'disabled', … ) when rendering media buttons to correctly reflect boolean disabled state. |
| src/js/media/controllers/cropper.js | Uses .prop( 'disabled', true ) when disabling the crop action button during processing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Under jQuery 4.0, disabling a media button or the image cropper's action button triggered a jQuery Migrate warning about the boolean `disabled` attribute. These buttons now toggle the `disabled` property instead, which removes the warning and keeps the behavior unchanged. Developed in: #10661 Props audrasjb, azaozz, hbhalodia, neo2k23, wildworks. See #64425. git-svn-id: https://develop.svn.wordpress.org/trunk@62963 602fd350-edb4-49c9-b593-d223f7449a82
Under jQuery 4.0, disabling a media button or the image cropper's action button triggered a jQuery Migrate warning about the boolean `disabled` attribute. These buttons now toggle the `disabled` property instead, which removes the warning and keeps the behavior unchanged. Developed in: WordPress/wordpress-develop#10661 Props audrasjb, azaozz, hbhalodia, neo2k23, wildworks. See #64425. Built from https://develop.svn.wordpress.org/trunk@62963 git-svn-id: http://core.svn.wordpress.org/trunk@62204 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Trac ticket: https://core.trac.wordpress.org/ticket/64425
attrto useprop.This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.