ignore swatch whitespace

This commit is contained in:
Cory LaViska
2023-01-06 13:28:30 -05:00
parent fbcb4d8dbd
commit 041364fb7d
2 changed files with 5 additions and 2 deletions

View File

@@ -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 `<sl-select>` when `multiple` was used [#1109](https://github.com/shoelace-style/shoelace/issues/1109)
- Fixed a bug in `<sl-select>` that prevented placeholders from showing when `multiple` was used [#1109](https://github.com/shoelace-style/shoelace/issues/1109)
- Fixed a bug in `<sl-color-picker>` that logged a console error when parsing swatches with whitespace
## 2.0.0-beta.88

View File

@@ -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`
<div