Open thekingofcity opened 11 months ago
I found the reason.
In Runtime-slice.ts
, when we open palette App Clip and change the color, it will trigger onPaletteAppClipEmit()
and change the key of output
.
But, when we open palette app clip without any change, it will trigger closePaletteAppClip()
and the key of output
won't be changed.
In tools.tsx
,
The problem comes out here. When you open the app clip, isThemeRequested
is set to true
. When you close the app clip without any changes, the output
do NOT be changed, so this function won't be run, and isThemeRequested
is still true
.
If you open app clip from other place and pick up a color after that, the output
is changed and the function is run and set the wrong key to runtime.theme
.
To sum up, we should identify who call the app clip and pass the key ONLY to it.
And also set isThemeRequested
back to false
on time to avoid receiving the key not for itself.
Colors of previous open unchanged color fields will be changed after confirmation.
Reproduce steps:
- Click on any element that has a color field input.
- Click the color field at the top of the left tools panel.
- Close the panel without any interaction.
- Click the color field in the details panel.
- Select a color and confirm.
- Note both color in the tools and details panel changed.
In fact, if we swap the step 2 and step 4, the color in details panel will be accidentally changed too.
Colors of previous open unchanged color fields will be changed after confirmation.
Reproduce steps: