File tree Expand file tree Collapse file tree
packages/vuetify/src/components/VColorPicker Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2828 background : $color-picker-checkerboard
2929 cursor : pointer
3030
31+ & --disabled
32+ opacity : var(-- v- disabled- opacity)
33+ pointer-events : none
34+
3135 > div
3236 display : flex
3337 align-items : center
Original file line number Diff line number Diff line change @@ -69,6 +69,14 @@ export const VColorPickerSwatches = defineComponent({
6969 } ,
7070
7171 setup ( props , { emit } ) {
72+ function onSwatchClick ( hsva : HSV ) {
73+ if ( props . disabled || ! hsva ) {
74+ return
75+ }
76+
77+ emit ( 'update:color' , hsva )
78+ }
79+
7280 useRender ( ( ) => (
7381 < div
7482 class = { [
@@ -90,8 +98,13 @@ export const VColorPickerSwatches = defineComponent({
9098
9199 return (
92100 < div
93- class = "v-color-picker-swatches__color"
94- onClick = { ( ) => hsva && emit ( 'update:color' , hsva ) }
101+ class = { [
102+ 'v-color-picker-swatches__color' ,
103+ {
104+ 'v-color-picker-swatches__color--disabled' : props . disabled ,
105+ } ,
106+ ] }
107+ onClick = { ( ) => onSwatchClick ( hsva ) }
95108 >
96109 < div style = { { background } } >
97110 { props . color && deepEqual ( props . color , hsva )
You can’t perform that action at this time.
0 commit comments