kopia lustrzana https://github.com/shoelace-style/shoelace
Merge branch 'next' into cem-better-data
commit
8dab5a8f04
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
Ładowanie…
Reference in New Issue