You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Global Styles: Reselecting the original styles from color swatch triggers changes #70285
Currently, when I change the style (text color, background color, link color, etc.) and then revert it back to the original by clicking on the color swatch, the review button still gets triggered—even though no actual change has occurred. While clicking the ‘Clear’ button resolves this issue for other elements, it doesn’t work for ‘Text Color’. Focus issue for Text Color: #60614.
Step-by-step reproduction instructions
Open the Site Editor.
Navigate to Styles > Colors.
Change the Text Color using the color swatch, then click back on the original color.
Notice that the Review Changes button appears, even though the color is reverted.
Refresh the page.
Now repeat the color switching process with Background, Links, etc.
Observe that the Clear button removes the Review Changes button. However, switching back to the original color from another still triggers the Review Changes button.
changed the title [-]DataViews: Reselecting the original styles from color swatch triggers changes[/-][+]Global Styles: Reselecting the original styles from color swatch triggers changes[/+]on Jun 2, 2025
I have tested this with the latest trunk and WordPress 6.8.1, and I’m unable to reproduce the issue. You can check the first screencast below for reference.
Screen.Recording.2025-06-04.at.9.36.41.AM.mov
Separately, I noticed another UX issue, which I’ve recorded in the second screencast. When I open the text color panel, make some changes, and then open the background color panel, the text color panel remains open. Ideally, selecting a new panel should close the previously opened one. However, when I open the panel do some changes, revert that changes and open another panel, the previous one remains open.
When I open a panel and do not do anything and then open another panel, the previous one closes (which is expected to happen and ideal).
Screen.Recording.2025-06-04.at.9.37.11.AM.mov
Let me know should we modify this issue or create a new one to address this.
Thanks for taking the time and looking into the issue,
I think there is some mistake in conveying, I would suggest you try to switch back to the original color without clicking on the 'Clear' button, that's where the issue is, the 'Review Changes' button appears then which is not ideal
Separately, I noticed another UX issue, which I’ve recorded in the second screencast. When I open the text color panel, make some changes, and then open the background color panel, the text color panel remains open. Ideally, selecting a new panel should close the previously opened one. However, when I open the panel do some changes, revert that changes and open another panel, the previous one remains open.
I think there is some mistake in conveying, I would suggest you try to switch back to the original color without clicking on the 'Clear' button, that's where the issue is, the 'Review Changes' button appears then which is not ideal
and it is actually changing the context and triggers the change, now when you again revert to same color which was set, but since context has now changed to new color, it would identify this as a change as well and again would change the context so previous and new context is not the same always, but it would be same, when we are setting the value in setStyle with undefined, becuase that would not change it's value it would return the old one, hence on clear and click same color again is not reproducing the issue.
Activity
[-]DataViews: Reselecting the original styles from color swatch triggers changes[/-][+]Global Styles: Reselecting the original styles from color swatch triggers changes[/+]hbhalodia commentedon Jun 4, 2025
Hi @Rishit30G,
I have tested this with the latest trunk and WordPress 6.8.1, and I’m unable to reproduce the issue. You can check the first screencast below for reference.
Screen.Recording.2025-06-04.at.9.36.41.AM.mov
Separately, I noticed another UX issue, which I’ve recorded in the second screencast. When I open the text color panel, make some changes, and then open the background color panel, the text color panel remains open. Ideally, selecting a new panel should close the previously opened one. However, when I open the panel do some changes, revert that changes and open another panel, the previous one remains open.
When I open a panel and do not do anything and then open another panel, the previous one closes (which is expected to happen and ideal).
Screen.Recording.2025-06-04.at.9.37.11.AM.mov
Let me know should we modify this issue or create a new one to address this.
Thank You,
Rishit30G commentedon Jun 4, 2025
Hi @hbhalodia
Thanks for taking the time and looking into the issue,
I think there is some mistake in conveying, I would suggest you try to switch back to the original color without clicking on the 'Clear' button, that's where the issue is, the 'Review Changes' button appears then which is not ideal
We have a similar issue: #60614
hbhalodia commentedon Jun 4, 2025
Will check this 👁.
Thanks for pointing out 👍.
hbhalodia commentedon Jun 4, 2025
Hi @Rishit30G @t-hamano, I tried to debugged the issue, but seems like it is acting as a issue but actually is not because,
gutenberg/packages/block-editor/src/components/global-styles/color-panel.js
Lines 444 to 458 in a5e3592
This would always trigger,
onChange()and in that funtion, we are setting the style via hook,useGlobalStylegutenberg/packages/block-editor/src/components/global-styles/hooks.js
Lines 151 to 210 in a5e3592
and it is actually changing the context and triggers the change, now when you again revert to same color which was set, but since context has now changed to new color, it would identify this as a change as well and again would change the context so previous and new context is not the same always, but it would be same, when we are setting the value in
setStylewith undefined, becuase that would not change it's value it would return the old one, hence on clear and click same color again is not reproducing the issue.