From 041364fb7dd434e121f42bc1563d2403cf3e47e0 Mon Sep 17 00:00:00 2001 From: Cory LaViska Date: Fri, 6 Jan 2023 13:28:30 -0500 Subject: [PATCH] ignore swatch whitespace --- docs/resources/changelog.md | 3 ++- src/components/color-picker/color-picker.ts | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/resources/changelog.md b/docs/resources/changelog.md index f516dd5c5..59a3c36e0 100644 --- a/docs/resources/changelog.md +++ b/docs/resources/changelog.md @@ -10,7 +10,8 @@ New versions of Shoelace are released as-needed and generally occur when a criti ## Next -- Fixed a bug that prevented placeholders from showing in `` when `multiple` was used [#1109](https://github.com/shoelace-style/shoelace/issues/1109) +- Fixed a bug in `` that prevented placeholders from showing when `multiple` was used [#1109](https://github.com/shoelace-style/shoelace/issues/1109) +- Fixed a bug in `` that logged a console error when parsing swatches with whitespace ## 2.0.0-beta.88 diff --git a/src/components/color-picker/color-picker.ts b/src/components/color-picker/color-picker.ts index 1040dd6e5..a849b9a45 100644 --- a/src/components/color-picker/color-picker.ts +++ b/src/components/color-picker/color-picker.ts @@ -425,6 +425,8 @@ export default class SlColorPicker extends ShoelaceElement implements ShoelaceFo this.emit('sl-input'); } + // console.log(this.hue, this.saturation, this.lightness); + setTimeout(() => this.input.select()); } else { this.hue = 0; @@ -707,7 +709,7 @@ export default class SlColorPicker extends ShoelaceElement implements ShoelaceFo const gridHandleY = 100 - this.brightness; const swatches = Array.isArray(this.swatches) ? this.swatches // allow arrays for legacy purposes - : this.swatches.split(';').filter(color => color !== ''); + : this.swatches.split(';').filter(color => color.trim() !== ''); const colorPicker = html`