From d3c0cf30ca205a313deab5de640904ac0e137065 Mon Sep 17 00:00:00 2001 From: Juanfran Date: Tue, 31 Dec 2024 18:24:57 +0100 Subject: [PATCH] fix: clear color picker --- libs/ui/src/lib/color-picker/color-picker.component.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libs/ui/src/lib/color-picker/color-picker.component.ts b/libs/ui/src/lib/color-picker/color-picker.component.ts index 51a4480e..8261daac 100644 --- a/libs/ui/src/lib/color-picker/color-picker.component.ts +++ b/libs/ui/src/lib/color-picker/color-picker.component.ts @@ -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);