Editor Always applies Color( with same color values but diff slug and name )declared first irrespective of Color applied
Description
If Theme have declared two colors with same color value but different slug and name
for ex : {
"color": "#ffffff",
"name": "Text 1",
"slug": "text-2"
},
{
"color": "#ffffff",
"name": "Text 2",
"slug": "text-1"
},
Then if in editor a text 2 color is selected, still the editor will apply text-1.
This will cause issues when styles are changed. What if the colors values change in style declarations ? I also remember patterns will also have styles option in coming future, it will cause issues then
Step-by-step reproduction instructions
- Create Theme.json and add two Colors, Keep the values of color same , but slug and name different.
- Open Editor and add two components .
- Apply one color to each of component added.
- Open Code Editor and you can see the color added in markup is always the first
Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
Hi, This issue has gone 30 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps. Thanks for helping out.
Sad to see this is stale and not receiving attention 😔 Unfortunately I lack the knowledge to contribute fixing it. As WordPress user, this issue is very annoying for me.
#55516 #9357
@jeflopodev thanks for the heads-up. Indeed, this is a duplicate of https://github.com/WordPress/gutenberg/issues/9357
Let's continue the conversation there