mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 04:09:12 +00:00
backport SL-2318
This commit is contained in:
@@ -14,6 +14,7 @@ During the alpha period, things might break! We take breaking changes very serio
|
||||
|
||||
# Next
|
||||
|
||||
- Improved performance of `<wa-select>` when using a large number of options
|
||||
- Updated the Japanese translation
|
||||
|
||||
## 3.0.0-alpha.7
|
||||
|
||||
@@ -36,6 +36,7 @@ export default class WaOption extends WebAwesomeElement {
|
||||
|
||||
// @ts-expect-error - Controller is currently unused
|
||||
private readonly localize = new LocalizeController(this);
|
||||
private isInitialized = false;
|
||||
|
||||
@query('.label') defaultSlot: HTMLSlotElement;
|
||||
|
||||
@@ -60,13 +61,17 @@ export default class WaOption extends WebAwesomeElement {
|
||||
}
|
||||
|
||||
private handleDefaultSlotChange() {
|
||||
// When the label changes, tell the controller to update
|
||||
customElements.whenDefined('wa-select').then(() => {
|
||||
const controller = this.closest('wa-select');
|
||||
if (controller) {
|
||||
controller.handleDefaultSlotChange();
|
||||
}
|
||||
});
|
||||
if (this.isInitialized) {
|
||||
// When the label changes, tell the controller to update
|
||||
customElements.whenDefined('wa-select').then(() => {
|
||||
const controller = this.closest('wa-select');
|
||||
if (controller) {
|
||||
controller.handleDefaultSlotChange();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.isInitialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
private handleMouseEnter() {
|
||||
|
||||
Reference in New Issue
Block a user