Skip to content

Commit 12d8f75

Browse files
committed
Disable elements when color picker is disabled
1 parent af8b738 commit 12d8f75

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

packages/uui-color-picker/lib/uui-color-picker.element.ts

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -558,14 +558,18 @@ export class UUIColorPickerElement extends LabelMixin('label', LitElement) {
558558
'color-picker--disabled': this.disabled,
559559
})}
560560
aria-disabled=${this.disabled ? 'true' : 'false'}>
561-
<uui-color-area .value="${this.value}" @change=${this.handleGridChange}>
561+
<uui-color-area
562+
.value="${this.value}"
563+
?disabled=${this.disabled}
564+
@change=${this.handleGridChange}>
562565
</uui-color-area>
563566
<div class="color-picker__controls">
564567
<div class="color-picker__sliders">
565568
<uui-color-slider
566569
label="hue"
567570
class="hue-slider"
568571
.value=${Math.round(this.hue)}
572+
?disabled=${this.disabled}
569573
@change=${this.handleHueChange}>
570574
</uui-color-slider>
571575
${this.opacity
@@ -576,6 +580,7 @@ export class UUIColorPickerElement extends LabelMixin('label', LitElement) {
576580
.value=${Math.round(this.alpha)}
577581
type="opacity"
578582
.color=${this.value}
583+
?disabled=${this.disabled}
579584
@change=${this.handleAlphaChange}>
580585
</uui-color-slider>
581586
`
@@ -610,21 +615,21 @@ export class UUIColorPickerElement extends LabelMixin('label', LitElement) {
610615
</uui-input>
611616
<uui-button-group>
612617
${!this.noFormatToggle
613-
? html`
614-
<uui-button
618+
? html`<uui-button
615619
label="Toggle color format"
616620
@click=${this.handleFormatToggle}
617621
class="color-picker__toggle-format"
622+
?disabled=${this.disabled}
618623
compact>
619624
<span>${this.format}</span>
620-
</uui-button>
621-
`
625+
</uui-button>`
622626
: ''}
623627
${hasEyeDropper
624-
? html` <uui-button
628+
? html`<uui-button
625629
label="Select a color"
626-
compact
627-
@click=${this.handleEyeDropper}>
630+
?disabled=${this.disabled}
631+
@click=${this.handleEyeDropper}
632+
compact>
628633
<uui-icon-registry-essential>
629634
<uui-icon name="colorpicker"></uui-icon>
630635
</uui-icon-registry-essential>

0 commit comments

Comments
 (0)