@vollowx/seele 0.8.9 → 0.8.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/base/list-item.js +3 -0
- package/src/base/select.js +5 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vollowx/seele",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.10",
|
|
4
4
|
"description": "Standard Extensible Elements. A web components library that can be styled and extended freely, pre-providing components in Material Design 3.",
|
|
5
5
|
"author": "vollowx",
|
|
6
6
|
"license": "MIT",
|
package/src/base/list-item.js
CHANGED
|
@@ -13,6 +13,9 @@ export class ListItem extends FormAssociated(InternalsAttached(LitElement)) {
|
|
|
13
13
|
this._role = 'option';
|
|
14
14
|
}
|
|
15
15
|
static { this.styles = [hiddenStyles]; }
|
|
16
|
+
get displayText() {
|
|
17
|
+
return this.innerText.trim();
|
|
18
|
+
}
|
|
16
19
|
connectedCallback() {
|
|
17
20
|
super.connectedCallback();
|
|
18
21
|
this[internals].role = this._role;
|
package/src/base/select.js
CHANGED
|
@@ -272,12 +272,16 @@ export class Select extends Base {
|
|
|
272
272
|
changed = this.lastSelectedOption !== firstSelectedOption;
|
|
273
273
|
this.lastSelectedOption = firstSelectedOption;
|
|
274
274
|
this[VALUE] = firstSelectedOption.value;
|
|
275
|
-
this.displayText = firstSelectedOption.
|
|
275
|
+
this.displayText = firstSelectedOption.displayText;
|
|
276
276
|
}
|
|
277
277
|
else {
|
|
278
278
|
changed = this.lastSelectedOption !== null;
|
|
279
279
|
this.lastSelectedOption = null;
|
|
280
280
|
this[VALUE] = '';
|
|
281
|
+
// Keep displayText if it was set (e.g., from SSR) and options aren't available yet.
|
|
282
|
+
if (this.options.length === 0 && this.displayText) {
|
|
283
|
+
return changed;
|
|
284
|
+
}
|
|
281
285
|
this.displayText = '';
|
|
282
286
|
}
|
|
283
287
|
return changed;
|