Skip to content
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

Global Styles: use color hex + index as key in the Palette component color indicator #44344

Merged
merged 2 commits into from
Sep 26, 2022

Commits on Sep 22, 2022

  1. use slug as color indicator key in gs palette

    In the global styles panel's palette component, the color's hex code is
    used as a `key` for the ColorIndicatorWrapper, but the hex is not
    necessarily a unique identifier, unlike the `slug` attribute, which is
    expected to be unique. Using slug as key prevents errors such as this:
    
    > Warning: Encountered two children with the same key, `.$#040DE1`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.
    
    with a palette that looks lilke this:
    
    ```json
    [
    	{
    			"color": "#040DE1",
    			"name": "Primary",
    			"slug": "primary"
    	},
    	{
    			"color": "#040DE1",
    			"name": "Foreground",
    			"slug": "foreground"
    	},
    ]
    
    ```
    vcanales committed Sep 22, 2022
    Configuration menu
    Copy the full SHA
    4f01d52 View commit details
    Browse the repository at this point in the history

Commits on Sep 23, 2022

  1. Configuration menu
    Copy the full SHA
    7a229f6 View commit details
    Browse the repository at this point in the history