chore: fix selection issue when deleting items on mobile [skip e2e]
This commit is contained in:
@@ -266,8 +266,10 @@ export class ItemListController
|
|||||||
this.disposers.push(
|
this.disposers.push(
|
||||||
reaction(
|
reaction(
|
||||||
() => this.selectedItemsCount,
|
() => this.selectedItemsCount,
|
||||||
() => {
|
(count, prevCount) => {
|
||||||
if (this.selectedItemsCount === 0) {
|
const hasNoSelectedItem = count === 0
|
||||||
|
const onlyOneSelectedItemAfterChange = prevCount > count && count === 1
|
||||||
|
if (hasNoSelectedItem || onlyOneSelectedItemAfterChange) {
|
||||||
this.cancelMultipleSelection()
|
this.cancelMultipleSelection()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1193,9 +1195,6 @@ export class ItemListController
|
|||||||
this.setSelectedUuids(this.selectedUuids)
|
this.setSelectedUuids(this.selectedUuids)
|
||||||
this.lastSelectedItem = item
|
this.lastSelectedItem = item
|
||||||
}
|
}
|
||||||
if (this.selectedItemsCount === 1) {
|
|
||||||
this.cancelMultipleSelection()
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
const shouldSelectNote = hasMoreThanOneSelected || !this.selectedUuids.has(uuid)
|
const shouldSelectNote = hasMoreThanOneSelected || !this.selectedUuids.has(uuid)
|
||||||
if (shouldSelectNote && isAuthorizedForAccess) {
|
if (shouldSelectNote && isAuthorizedForAccess) {
|
||||||
|
|||||||
Reference in New Issue
Block a user