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

BaguetteBox must not exit fullscreen if it did not enter fullscreen itself. #220

Open
LeoniePhiline opened this issue Aug 20, 2019 · 0 comments

Comments

@LeoniePhiline
Copy link

LeoniePhiline commented Aug 20, 2019

The closeButtonClickHandler calls exitFullScreen() even if the document was in fullscreen mode before baguette box was opened, and even if options.fullScreen is false.

This breaks websites & apps handling their own fullscreen mode:
When the website/app is in fullscreen mode, opening and then closing a baguetteBox will make the entire app exit fullscreen. This is breaking UX badly.

Options:

  1. At least check options.fullScreen (like before calling enterFullScreen()) and do not exitFullScreen() if options.fullScreen is false.

  2. Track the fullScreen state in showOverlay() and only exit fullScreen if the document was not already in fullScreen mode during showOverlay().

  3. Ideally replace document.fullscreen.

  • It is deprecated and hardly supported any longer: https://developer.mozilla.org/en-US/docs/Web/API/Document/fullscreen
  • Instead, use the current fullscreen API.
    • You can apply fullScreen to the baguetteBox root element instead of the entire document.
    • If document.fullscreenElement is already not null, then do not go fullscreen at all.
    • Also, do not exit fullscreen if document.fullscreenElement is not the baguetteBox element.
@LeoniePhiline LeoniePhiline changed the title BaguetteBox must not exist fullscreen if it did not go fullsreen itself. BaguetteBox must not exist fullscreen if it did not enter fullsreen itself. Aug 20, 2019
@LeoniePhiline LeoniePhiline changed the title BaguetteBox must not exist fullscreen if it did not enter fullsreen itself. BaguetteBox must not exist fullscreen if it did not enter fullscreen itself. Aug 20, 2019
@LeoniePhiline LeoniePhiline changed the title BaguetteBox must not exist fullscreen if it did not enter fullscreen itself. BaguetteBox must not exit fullscreen if it did not enter fullscreen itself. Aug 20, 2019
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

1 participant