Skip to content

Commit

Permalink
Merge pull request #783 from legion-labs/editor-client-fix-color-pick…
Browse files Browse the repository at this point in the history
…er-autosave

Editor client: Manually dispatch change event in Color Property property (#690)
  • Loading branch information
kevin-legion authored Jan 5, 2022
2 parents f8d386a + 16a89ec commit ba0790e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions client/editor/frontend/src/components/ColorPicker.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ It also supports manual RGBA edition with 4 different inputs.
hColor = { r, g, b, a: 255 };
}
$: dispatch("change", colors);
/** Called when the user changes the Saturation and Value */
function svSelect(
event: MouseEvent & { currentTarget: EventTarget & HTMLDivElement }
Expand All @@ -98,6 +96,8 @@ It also supports manual RGBA edition with 4 different inputs.
v: 100 - yPercentage,
a: colors.hsv.a,
});
dispatch("change", colors);
}
function updateHue(
Expand All @@ -107,6 +107,8 @@ It also supports manual RGBA edition with 4 different inputs.
...colors.hsv,
h: +event.currentTarget.value,
});
dispatch("change", colors);
}
function updateAlpha(
Expand All @@ -117,6 +119,8 @@ It also supports manual RGBA edition with 4 different inputs.
...colors.hsv,
a: +event.currentTarget.value,
});
dispatch("change", colors);
}
function updateRgbaColor(
Expand All @@ -128,6 +132,8 @@ It also supports manual RGBA edition with 4 different inputs.
...colors.rgba,
[key]: newColorPart,
});
dispatch("change", colors);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
dispatch("input", value);
}
function setColorsFromTextInput({ detail: newValue }: CustomEvent<string>) {
setColors(newValue);
function setColorsFromTextInput({ detail: hex }: CustomEvent<string>) {
setColors(hex);
}
function setColorsFromColorPicker({
Expand Down

0 comments on commit ba0790e

Please sign in to comment.