@@ -46,7 +46,7 @@ const Self = class ColorScale extends ColorElement {
4646 handleEvent ( event ) {
4747 let source = event . target ;
4848
49- if ( event . type === "input" && ( ! this . editable ?. name || ! source . matches ( "input[slot=before] " ) ) ) {
49+ if ( event . type === "input" && ( ! this . editable ?. name || ! source . matches ( ".color-name.editable " ) ) ) {
5050 // Ignore input events from the color input: the color changes are handled by the colorchange event
5151 return ;
5252 }
@@ -116,7 +116,7 @@ const Self = class ColorScale extends ColorElement {
116116 if ( this . editable ?. color ) {
117117 // Focus the new color input and select its content
118118 let swatch = this . _el . swatches . lastElementChild ;
119- let input = swatch . querySelector ( "input:not([slot] " ) ;
119+ let input = swatch . querySelector ( "input.color.editable " ) ;
120120 input . focus ( ) ;
121121 input . select ( ) ;
122122 }
@@ -132,7 +132,7 @@ const Self = class ColorScale extends ColorElement {
132132 return ;
133133 }
134134
135- let colorNameElement = swatch . querySelector ( "[slot=before] " ) ;
135+ let colorNameElement = swatch . querySelector ( ".color-name " ) ;
136136 let colorName = colorNameElement ?. value ?? colorNameElement ?. textContent ?? swatch . textContent ;
137137
138138 this . colors = { ...this . colors , [ colorName ] : color } ;
@@ -178,7 +178,7 @@ const Self = class ColorScale extends ColorElement {
178178 return ;
179179 }
180180
181- let colorNameElement = swatch . querySelector ( "[slot=before] " ) ;
181+ let colorNameElement = swatch . querySelector ( ".color-name " ) ;
182182 let colorName = colorNameElement ?. value ?? colorNameElement ?. textContent ?? swatch . textContent ;
183183
184184 swatch . remove ( ) ;
0 commit comments