Merge branch 'next' into cem-better-data

pull/1038/head
Cory LaViska 2022-11-28 16:07:29 -05:00
commit 8dab5a8f04
3 zmienionych plików z 8 dodań i 10 usunięć

Wyświetl plik

@ -13,6 +13,7 @@ New versions of Shoelace are released as-needed and generally occur when a criti
- Fixed a bug in `<sl-dropdown>` that caused containing dialogs, drawers, etc. to close when pressing <kbd>Escape</kbd> while focused [#1024](https://github.com/shoelace-style/shoelace/issues/1024)
- Fixed a bug in `<sl-tree-item>` that allowed lazy nodes to be incorrectly selected [#1023](https://github.com/shoelace-style/shoelace/pull/1023)
- Fixed a typing bug in `<sl-tree-item>` [#1026](https://github.com/shoelace-style/shoelace/pull/1026)
- Fixed a bug in `<sl-tree-item>` where `sl-selection-change` was emitted when the selection didn't change [#1030](https://github.com/shoelace-style/shoelace/pull/1030)
- Updated Floating UI to 1.0.7 to fix a bug that prevented `hoist` from working correctly in `<sl-dropdown>` after a recent update [#1024](https://github.com/shoelace-style/shoelace/issues/1024)
## 2.0.0-beta.84

Wyświetl plik

@ -120,15 +120,6 @@ fs.mkdirSync(outdir, { recursive: true });
routes: {
'/dist': './dist'
}
},
socket: {
socketIoClientConfig: {
// Configure socketIO to retry forever when disconnected to enable the auto-reattach timeout below to work
reconnectionAttempts: Infinity,
reconnectionDelay: 500,
reconnectionDelayMax: 500,
timeout: 1000
}
}
};

Wyświetl plik

@ -177,6 +177,8 @@ export default class SlTree extends ShoelaceElement {
}
selectItem(selectedItem: SlTreeItem) {
const previousSelection = [...this.selectedItems];
if (this.selection === 'multiple') {
selectedItem.selected = !selectedItem.selected;
if (selectedItem.lazy) {
@ -192,7 +194,11 @@ export default class SlTree extends ShoelaceElement {
selectedItem.expanded = !selectedItem.expanded;
}
this.emit('sl-selection-change', { detail: { selection: this.selectedItems } });
const nextSelection = this.selectedItems;
if (nextSelection.some(item => !previousSelection.includes(item))) {
this.emit('sl-selection-change', { detail: { selection: nextSelection } });
}
}
// Returns the list of tree items that are selected in the tree.