Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modal opens behind fullscreen pages. #39

Open
jowilhnson opened this issue Jul 11, 2016 · 2 comments
Open

Modal opens behind fullscreen pages. #39

jowilhnson opened this issue Jul 11, 2016 · 2 comments

Comments

@jowilhnson
Copy link

I am in the process of replacing standard alert and confirm dialog boxes with modals because they look so much nicer. I've run into a problem where if the page is in fullscreen, unlike confirm and alert dialogs, the modal does not open over the page, instead it appears behind it and is not visible until the user hits Esc to exit fullscreen.

My current workaround is to add code to exit fullscreen before showing the modal, but this isn't perfect and if there's a way to make the modal open over the fullscreen page, that would be much better.

I tried setting the z-index on .modal and .modal-open classes to 1100, but that didn't effect anything.
Any tips would be appreciated.

@PeppeL-G
Copy link
Owner

PeppeL-G commented Jul 11, 2016

You used theElement.requestFullscreen() to enter fullscreen? Then I guess the browser will only show theElement and its children, and that becomes a problem since Modal.show('templateName') will insert the modal into document.body.

Well, I guess the problem is nailed down, but I don't have a good solution for it at the moment. I guess passing an optional parent element to Modal.show (and use document.body as default) is one way to go, but if anyone has any other idea I'm listening.

@jowilhnson
Copy link
Author

That makes sense. I am requesting fullscreen on an element that is a child of document.body. For now I'll keep using my workaround of exiting fullscreen to display the modal, but will keep thinking about a better solution now that I understand what's happening better. Thanks for explaining that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants