Fix visibility check for elements in fixed-position modals

offsetParent returns null for elements inside position:fixed containers.
Use getComputedStyle instead to check display and visibility.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Eric Wagoner
2025-12-24 10:49:45 -05:00
parent ce6670e35b
commit 7d39ea4dd8

View File

@@ -1186,7 +1186,9 @@
function getFocusableElements(container) {
const elements = container.querySelectorAll('button, input:not([type="hidden"]), select, textarea, [tabindex]:not([tabindex="-1"])');
return Array.from(elements).filter(el => {
return el.offsetParent !== null && !el.disabled;
if (el.disabled) return false;
const style = window.getComputedStyle(el);
return style.display !== 'none' && style.visibility !== 'hidden';
});
}