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:
@@ -1186,7 +1186,9 @@
|
|||||||
function getFocusableElements(container) {
|
function getFocusableElements(container) {
|
||||||
const elements = container.querySelectorAll('button, input:not([type="hidden"]), select, textarea, [tabindex]:not([tabindex="-1"])');
|
const elements = container.querySelectorAll('button, input:not([type="hidden"]), select, textarea, [tabindex]:not([tabindex="-1"])');
|
||||||
return Array.from(elements).filter(el => {
|
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';
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user