Skip to content

Commit

Permalink
fix(VColorPicker): reset canvas handle position when color = null
Browse files Browse the repository at this point in the history
  • Loading branch information
KaelWD committed Feb 15, 2023
1 parent 9a4caf3 commit f00ee78
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,12 @@ export const VColorPickerCanvas = defineComponent({
return
}

if (!props.color) return

isOutsideUpdate.value = true

dotPosition.value = {
dotPosition.value = props.color ? {
x: props.color.s * parseInt(props.width, 10),
y: (1 - props.color.v) * parseInt(props.height, 10),
}
} : { x: 0, y: 0 }
}, { deep: true, immediate: true })

onMounted(() => updateCanvas())
Expand Down

0 comments on commit f00ee78

Please sign in to comment.