fix: 修复 shift 点击时 maxKeepItemSelectionLength 失效问题 (#2827)

This commit is contained in:
吴多益 2021-11-02 22:24:34 +08:00 committed by GitHub
parent 1ab8df289e
commit 3a8be30316
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1031,8 +1031,10 @@ export const TableStore = iRendererStore
if (idx === -1) {
// 如果上一个是选中状态,则将之间的所有 check 都变成可选
if (lastCheckedRow.checked) {
if (maxLength && self.selectedRows.length < maxLength) {
self.selectedRows.push(rowItem);
if (maxLength) {
if (self.selectedRows.length < maxLength) {
self.selectedRows.push(rowItem);
}
} else {
self.selectedRows.push(rowItem);
}