mirror of
https://github.com/netbox-community/netbox.git
synced 2026-02-04 06:16:23 -06:00
Fixes #18619: shift-select selects hidden items
This also fixes the inverse, when a range is unselected via shift-click, previously checked checkboxes that are hidden are not changed.
This commit is contained in:
committed by
Jeremy Stretch
parent
b5bc0bad38
commit
ed79e3bbf4
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+2
-2
File diff suppressed because one or more lines are too long
@@ -43,7 +43,9 @@ function toggleCheckboxRange(
|
|||||||
const typedElement = element as HTMLInputElement;
|
const typedElement = element as HTMLInputElement;
|
||||||
//Change loop's current checkbox state to eventTargetElement checkbox state
|
//Change loop's current checkbox state to eventTargetElement checkbox state
|
||||||
if (changePkCheckboxState === true) {
|
if (changePkCheckboxState === true) {
|
||||||
typedElement.checked = eventTargetElement.checked;
|
if (!typedElement.closest('tr')?.classList.contains('d-none')) {
|
||||||
|
typedElement.checked = eventTargetElement.checked;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//The previously clicked checkbox was above the shift clicked checkbox
|
//The previously clicked checkbox was above the shift clicked checkbox
|
||||||
if (element === previousStateElement) {
|
if (element === previousStateElement) {
|
||||||
@@ -52,7 +54,9 @@ function toggleCheckboxRange(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
changePkCheckboxState = true;
|
changePkCheckboxState = true;
|
||||||
typedElement.checked = eventTargetElement.checked;
|
if (!typedElement.closest('tr')?.classList.contains('d-none')) {
|
||||||
|
typedElement.checked = eventTargetElement.checked;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//The previously clicked checkbox was below the shift clicked checkbox
|
//The previously clicked checkbox was below the shift clicked checkbox
|
||||||
if (element === eventTargetElement) {
|
if (element === eventTargetElement) {
|
||||||
|
|||||||
Reference in New Issue
Block a user