Skip to content

Commit

Permalink
fix: clear color picker
Browse files Browse the repository at this point in the history
  • Loading branch information
juanfran committed Dec 31, 2024
1 parent 65da71f commit d3c0cf3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libs/ui/src/lib/color-picker/color-picker.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ export class ColorPickerComponent implements OnDestroy {
},
});

this.#pickr.on('clear', () => {
this.change.emit(undefined);
this.#pickr?.hide();
});

this.#pickr.on('change', (color: Pickr.HSVaColor | null) => {
if (this.mode() === 'HEX') {
this.change.emit(color?.toHEXA().toString() ?? undefined);
Expand Down

0 comments on commit d3c0cf3

Please sign in to comment.