You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use Glide.js for some components and want to showcase that in Storybook. There the component is displayed in an iframe, and when mounting a Glide instance, I get this error:
Root element must be a existing Html node
I am using an element reference in the constructor, not a selector, and double checked that this element does really exist. I tracked the error down to the exist-Function in src/utils/dom.js specifically this part:
nodeinstanceofwindow.HTMLElement
Apparently, elements inside an iframe are not an instance of window.HTMLElement but rather theiframelement.contentWindow.HTMLElement. I tested these cases:
I'm trying to use Glide.js for some components and want to showcase that in Storybook. There the component is displayed in an iframe, and when mounting a Glide instance, I get this error:
Root element must be a existing Html node
I am using an element reference in the constructor, not a selector, and double checked that this element does really exist. I tracked the error down to the
exist
-Function insrc/utils/dom.js
specifically this part:Apparently, elements inside an iframe are not an instance of
window.HTMLElement
but rathertheiframelement.contentWindow.HTMLElement
. I tested these cases:Chrome and Safari fail with the root-element error while it works in firefox.
A possible solution with more info can be found here https://stackoverflow.com/questions/384286/how-do-you-check-if-a-javascript-object-is-a-dom-object
The text was updated successfully, but these errors were encountered: