From a4fb3e19be9127b3d2e8076a9c968dcf4c8f64ce Mon Sep 17 00:00:00 2001 From: kolaente Date: Sat, 23 Jan 2021 18:41:13 +0100 Subject: [PATCH] Fix no color selected in the color picket --- src/components/input/colorPicker.vue | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/components/input/colorPicker.vue b/src/components/input/colorPicker.vue index fa11b7e3..2ad2d6e0 100644 --- a/src/components/input/colorPicker.vue +++ b/src/components/input/colorPicker.vue @@ -15,7 +15,9 @@ :rgbSliders="true" model="hex" picker="square" - v-model="color"/> + v-model="color" + :class="{'is-empty': empty}" + /> Reset Color @@ -57,9 +59,18 @@ export default { mounted() { this.color = this.value }, + computed: { + empty() { + return this.color === '#000000' || this.color === '' + }, + }, methods: { update() { + if(this.empty) { + return + } + if (this.lastChangeTimeout !== null) { clearTimeout(this.lastChangeTimeout) } @@ -78,3 +89,15 @@ export default { }, } + +