From de9d43f67a3d138284ce1b766fcffda62001f708 Mon Sep 17 00:00:00 2001 From: Cory LaViska Date: Fri, 18 Jun 2021 08:36:24 -0400 Subject: [PATCH] fixes #468 --- docs/resources/changelog.md | 4 ++++ src/components/color-picker/color-picker.ts | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/resources/changelog.md b/docs/resources/changelog.md index 5feb846a..f7fa5140 100644 --- a/docs/resources/changelog.md +++ b/docs/resources/changelog.md @@ -6,6 +6,10 @@ Components with the Experimental badge _During the beta period, these restrictions may be relaxed in the event of a mission-critical bug._ 🐛 +## Next + +- Fixed a bug in `sl-color-picker` where setting `value` immediately wouldn't trigger an update + ## 2.0.0-beta.44 - 🚨 BREAKING: all `invalid` props on form controls now reflect validity before interaction [#455](https://github.com/shoelace-style/shoelace/issues/455) diff --git a/src/components/color-picker/color-picker.ts b/src/components/color-picker/color-picker.ts index 487e49c2..69d01de8 100644 --- a/src/components/color-picker/color-picker.ts +++ b/src/components/color-picker/color-picker.ts @@ -554,17 +554,17 @@ export default class SlColorPicker extends LitElement { this.value = this.inputValue; } - @watch('format', { waitUntilFirstUpdate: true }) + @watch('format') handleFormatChange() { this.syncValues(); } - @watch('opacity', { waitUntilFirstUpdate: true }) + @watch('opacity') handleOpacityChange() { this.alpha = 100; } - @watch('value', { waitUntilFirstUpdate: true }) + @watch('value') handleValueChange(oldValue: string, newValue: string) { const newColor = this.parseColor(newValue);