Repository navigation
ColorPicker: Don't drop hex/RGB edits when the picker closes - #85734
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🤖 PR meta 🤖🎉 PropsIf 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. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: -13 B (0%) Total Size: 8.55 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
🏁 Flaky testsSome tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information. As a user I want to be able to add multiple close buttons so that users can close the overlay from different positions in
|
f4f44df to
a433cf2
Compare
What?
ColorPickernow callsonChangeright away for hex and RGB input instead of through a debounce. Before, typing a hex value in a gradient control point and pressing Escape right after could keep the old color, which made the "can apply custom gradient background color" e2e test flaky.Why?
Hex and RGB edits were committed through
useDebounce( setColor )with a 0ms wait, anduseDebouncecancels pending calls on unmount, so closing the popover dropped the edit. The debounce came from #36941 to stop a loop while dragging the picker in the gradient control point. Since #75493, picker drag goes throughhandleHSLAChangeand callssetColordirectly, and for discrete input events a 0ms debounce merged nothing.Testing Instructions
ff0000in the Hex field and press Escape. The control point and button background turn red.buttons.spec.jsnow checks the control point's accessible name after each edit. Before the fix, trunk's version of the test failed 10 of 10 runs locally with--trace off; after it, 10 of 10 pass.Testing Instructions for Keyboard
Same as above, using Tab to reach the control point and Enter to open it.
Use of AI Tools
Assisted by Claude.