Auto-commit local changes before build (2026-01-01 17:15:18) #6
@ -1 +1 @@
|
||||
v20260101-07-run-checks-shift-multiselect-delegation-fix
|
||||
v20260101-08-run-checks-shift-multiselect-persist
|
||||
|
||||
@ -289,7 +289,12 @@
|
||||
// Shift-click range selection for checkbox rows
|
||||
var lastCheckedCb = null;
|
||||
|
||||
function statusClass(status) {
|
||||
|
||||
|
||||
// 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();
|
||||
|
||||
// Allow derived display strings like "Success (override)"
|
||||
@ -376,12 +381,19 @@
|
||||
table.addEventListener('mousedown', function (e) {
|
||||
var t = e.target;
|
||||
if (!t) return;
|
||||
if (t.classList && t.classList.contains('rc_row_cb') && e.shiftKey) {
|
||||
|
||||
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) {
|
||||
e.preventDefault();
|
||||
if (window.getSelection) {
|
||||
try { window.getSelection().removeAllRanges(); } catch (err) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}, true);
|
||||
|
||||
// Handle Shift-click range selection on the checkbox inputs (delegated)
|
||||
@ -395,9 +407,15 @@ table.addEventListener('click', function (e) {
|
||||
e.stopPropagation();
|
||||
|
||||
// The default action would toggle the checkbox; do it manually
|
||||
var targetChecked = !t.checked;
|
||||
// Use the remembered pre-click state to avoid double toggling in some browsers
|
||||
var preChecked = (lastMouseDownCb === t ? lastMouseDownChecked : t.checked);
|
||||
var targetChecked = !preChecked;
|
||||
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);
|
||||
@ -422,7 +440,12 @@ table.addEventListener('click', function (e) {
|
||||
// Normal click: let default toggle happen, but remember the last checkbox
|
||||
lastCheckedCb = t;
|
||||
|
||||
// Defer update until after the checkbox state changes
|
||||
|
||||
|
||||
// Reset mousedown tracking
|
||||
lastMouseDownCb = null;
|
||||
lastMouseDownChecked = null;
|
||||
// Defer update until after the checkbox state changes
|
||||
setTimeout(updateButtons, 0);
|
||||
}, true);
|
||||
|
||||
|
||||
@ -151,6 +151,13 @@
|
||||
- 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
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user