mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 12:09:26 +00:00
fixes #704
This commit is contained in:
@@ -38,4 +38,11 @@ describe('<sl-color-picker>', () => {
|
||||
|
||||
expect(opacitySlider).to.exist;
|
||||
});
|
||||
|
||||
it('should display a color when an initial value is provided', async () => {
|
||||
const el = await fixture<SlColorPicker>(html` <sl-color-picker value="#000"></sl-color-picker> `);
|
||||
const trigger = el.shadowRoot!.querySelector<HTMLButtonElement>('[part="trigger"]');
|
||||
|
||||
expect(trigger?.style.color).to.equal('rgb(0, 0, 0)');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -164,7 +164,9 @@ export default class SlColorPicker extends LitElement {
|
||||
/** The locale to render the component in. */
|
||||
@property() lang: string;
|
||||
|
||||
firstUpdated() {
|
||||
connectedCallback() {
|
||||
super.connectedCallback();
|
||||
|
||||
if (!this.setColor(this.value)) {
|
||||
this.setColor(`#ffff`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user