Closed DimaGashko closed 4 years ago
@DimaGashko Thanks for opening this issue. Would you be open to creating a test case on codepen where we could see the issue?
I see, you added this to fix the bug: https://github.com/ghosh/Micromodal/blob/master/lib/src/index.js#L178 But it looks like you didn't do that in setFocusToFirstNode function: https://github.com/ghosh/Micromodal/blob/master/lib/src/index.js#L150
p.s. I'd like to have an option to disable behaviour of not focusing close targets on modal opening: https://github.com/ghosh/Micromodal/blob/master/lib/src/index.js#L160
Also setFocusToFirstNode doesn't check if the node is visible, so when I open a modal which contains a hidden input it tries to focus the hidden input (but fails and focuses the close target)
console.log(nodesWhichAreNotCloseTargets[0]);
Hi! I really like that you lock the focus inside the modal, but I've just found that if there are any hidden buttons (display: none in my case), then we can go out of the modal, and focus behavior becomes confusing.
p.s. I found it making a modal window than contains hidden "try again" button.