Compare commits

..

No commits in common. "9777cb2ea78d878eb5748434422fce6f6b9ae782" and "8e6fb4b66d52af5b345de7e44ceb35b47f65e504" have entirely different histories.

3 changed files with 8 additions and 38 deletions

View File

@ -1 +1 @@
v20260101-08-run-checks-shift-multiselect-persist
v20260101-07-run-checks-shift-multiselect-delegation-fix

View File

@ -289,11 +289,6 @@
// Shift-click range selection for checkbox rows
var lastCheckedCb = null;
// Track checkbox state before click to avoid double-toggle issues across browsers
var lastMouseDownCb = null;
var lastMouseDownChecked = null;
function statusClass(status) {
var s = (status || "").toString().toLowerCase();
@ -381,19 +376,12 @@ function statusClass(status) {
table.addEventListener('mousedown', function (e) {
var t = e.target;
if (!t) return;
if (t.classList && t.classList.contains('rc_row_cb')) {
// Remember state before click so Shift-click logic can reliably compute the intended target state
lastMouseDownCb = t;
lastMouseDownChecked = t.checked;
if (e.shiftKey) {
if (t.classList && t.classList.contains('rc_row_cb') && e.shiftKey) {
e.preventDefault();
if (window.getSelection) {
try { window.getSelection().removeAllRanges(); } catch (err) {}
}
}
}
}, true);
// Handle Shift-click range selection on the checkbox inputs (delegated)
@ -407,15 +395,9 @@ table.addEventListener('click', function (e) {
e.stopPropagation();
// The default action would toggle the checkbox; do it manually
// Use the remembered pre-click state to avoid double toggling in some browsers
var preChecked = (lastMouseDownCb === t ? lastMouseDownChecked : t.checked);
var targetChecked = !preChecked;
var targetChecked = !t.checked;
t.checked = targetChecked;
// Reset mousedown tracking once we've consumed it
lastMouseDownCb = null;
lastMouseDownChecked = null;
var cbs = Array.prototype.slice.call(table.querySelectorAll('tbody .rc_row_cb'));
var start = cbs.indexOf(lastCheckedCb);
var end = cbs.indexOf(t);
@ -440,11 +422,6 @@ table.addEventListener('click', function (e) {
// Normal click: let default toggle happen, but remember the last checkbox
lastCheckedCb = t;
// Reset mousedown tracking
lastMouseDownCb = null;
lastMouseDownChecked = null;
// Defer update until after the checkbox state changes
setTimeout(updateButtons, 0);
}, true);

View File

@ -151,13 +151,6 @@
- Disabled default browser text selection when using Shift during checkbox interaction.
- Applied Gmail-style range selection logic for consistent multi-row selection behavior.
---
## v20260101-08-run-checks-shift-multiselect-selection-retain
- Fixed Shift-click multi-select on the Run Checks page so the initial checkbox selection is preserved when selecting additional rows with Shift.
- Made Shift range selection use the checkbox pre-click state to prevent unintended double-toggles across browsers.
================================================================================================================================================
## v0.1.14