Problem with fullscreen feature with Web Component/Shadow DOM
See original GitHub issueI created a custom element using openseadragon
displayed in a <div>
works perfectly as long as do not move the Image
I can display Images sequences , collections
and zoom in and out,
but when move the image, it still works but is not displaye in the <div>
anymore,
it seems that it is reinjected somewhere else and displayed “fullpage” in the browser.
The togglebutton works but getting back is a complete mess
Here is a test page ( Zoomify tab )
Issue Analytics
- State:
- Created 4 years ago
- Comments:19 (10 by maintainers)
Top Results From Across the Web
ShadowRoot.fullscreenElement - Web APIs - MDN Web Docs
The fullscreenElement read-only property of the ShadowRoot interface returns the element within the shadow tree that is currently displayed ...
Read more >webkitfullscreenchange does not fire for shadow DOM elements
e.g. Added a regression test for making an element inside a shadow tree full screen, and listening to `webkitfullscreenchange` outside the shadow tree....
Read more >Fullscreen modal styles not extending beyond shadow DOM
I'm attempting to create a fullscreen modal within my shadow DOM custom element, but it seems that the styling for it doesn't extend...
Read more >Allow External Styling of a Web Component's Shadow DOM
The Shadow DOM protects your components from style conflicts. The same protection also makes it hard for users to modify the inner style...
Read more >How to Fullscreen a Specific Element in a Web Page
document.fullscreenElement/ShadowRoot.fullscreenElement : This property returns the content displayed in fullscreen mode on the current DOM (or shadow DOM), or ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@PCailly
For what it’s worth, here’s an example of what has worked well for me across user agents. Never used in shadow DOM though, but I would expect my user agent to handle it correctly because, as we all know, all browsers act the same ;-D
Note: The important thing here is the extra OpenSeadragon DIV with width and height 100%. The DIV with the class “viewer-container” would be your DIV that has a height 100vh. Using two DIVs, one with overflow:hidden and one with width/height 100%, seems to contain the OpenSeadragon viewer correctly across all browsers I’ve tested
If there’s dev tools with DOM element inspector available on the browser(s) it’s not working in, you should be able to see what element is covering the header row elements. I’d bet it’s the OpenSeadragon canvas…
@PCailly
I don’t understand what the “trick” is. To me all that does is obscure (off the bottom of the viewport) part of the 100vh height element. You can see this on an iPhone, for example, which lets you scroll your vertically-oversized viewport (100vh + the heights of the two header rows) into view.
For the issue, the only thing that “should” be happening when you click or zoom on the image is either the OpenSeadragon canvas “moves” (drag/pan), or in the case of a click, it zooms which increases the canvas size. Depending on the user agent and/or your CSS/styles, the OpenSeadragon canvas change may be displayed over the top of neighbor elements. Have you tried setting the OpenSeadragon containing DIV’s overflow to hidden?