Prevent Ctrl+A behavior in modals by checking for open modals before handling the key event

This commit is contained in:
Will Miao
2025-06-18 18:43:11 +08:00
parent 1ca05808e1
commit a615603866

View File

@@ -36,6 +36,11 @@ export class BulkManager {
document.addEventListener('keydown', (e) => {
// Check if it's Ctrl+A (or Cmd+A on Mac)
if ((e.ctrlKey || e.metaKey) && e.key === 'a') {
// First check if any modal is currently open - if so, don't handle Ctrl+A
if (modalManager.isAnyModalOpen()) {
return; // Exit early - let the browser handle Ctrl+A within the modal
}
// Prevent default browser "Select All" behavior
e.preventDefault();