Bugfix: Color Picker modal focus

Changes the event capture from `@input` to `@change`
to prevent losing focus on initial color selection.
This commit is contained in:
leekelleher
2024-05-13 21:36:12 +01:00
parent e1340f45bd
commit c4ac87bec2

View File

@@ -102,7 +102,7 @@ export class UmbMultipleColorPickerItemInputElement extends UUIFormControlMixin(
this.dispatchEvent(new UmbInputEvent());
}
#onColorInput(event: InputEvent) {
#onColorChange(event: Event) {
event.stopPropagation();
this.value = this._colorPicker.value;
this.dispatchEvent(new UmbChangeEvent());
@@ -153,7 +153,7 @@ export class UmbMultipleColorPickerItemInputElement extends UUIFormControlMixin(
value=${this._valueHex}
@click=${this.#onColorClick}></uui-color-swatch>
</uui-input>
<input aria-hidden="${true}" type="color" id="color" value=${this.value} @input=${this.#onColorInput} />
<input aria-hidden="${true}" type="color" id="color" value=${this.value} @change=${this.#onColorChange} />
</div>
${when(
this.showLabels,