fix(color picker): when picking a color, the color picker should not be black afterwards
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
b8c21c2ade
commit
c7b70844c6
@ -64,6 +64,15 @@ const emit = defineEmits(['update:modelValue'])
|
||||
watch(
|
||||
() => modelValue,
|
||||
(newValue) => {
|
||||
if (newValue === '' || newValue.startsWith('var(')) {
|
||||
color.value = ''
|
||||
return
|
||||
}
|
||||
|
||||
if (!newValue.startsWith('#') && (newValue.length === 6 || newValue.length === 3)) {
|
||||
newValue = `#${newValue}`
|
||||
}
|
||||
|
||||
color.value = newValue
|
||||
},
|
||||
{immediate: true},
|
||||
|
@ -24,7 +24,7 @@ export default class LabelModel extends AbstractModel<ILabel> implements ILabel
|
||||
super()
|
||||
this.assignData(data)
|
||||
|
||||
if (this.hexColor !== '' && this.hexColor.substring(0, 1) !== '#') {
|
||||
if (this.hexColor !== '' && !this.hexColor.startsWith('#') && !this.hexColor.startsWith('var(')) {
|
||||
this.hexColor = '#' + this.hexColor
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user