Skip to content

Commit

Permalink
fix value changed
Browse files Browse the repository at this point in the history
  • Loading branch information
jogibear9988 committed May 19, 2024
1 parent f30cb30 commit cbe89e7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/ColorWheel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,12 @@ export class ColorWheel extends BaseCustomWebComponentConstructorAppend {
return this.getAttribute('value') ?? '#ffffff';
}
public set value(value) {
this.setAttribute('value', value);
this.dispatchEvent(new CustomEvent('value-changed', { detail: { value } }));
if (!value)
value = '#ffffff';
if (value !== this.value) {
this.setAttribute('value', value);
this.dispatchEvent(new CustomEvent('value-changed', { detail: { value } }));
}
}

protected _pickerContainer: HTMLDivElement;
Expand Down

0 comments on commit cbe89e7

Please sign in to comment.