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
Describe the bug
The canvasElement that gets passed to the play function points to the root div element in the iframe (<div id="root">). However, if you are using createPortal (with a modal, for example), these elements will be appended outside of the root. This can lead to some confusion, as the elements that appears within the portal are not queryable in the typical manner.
To Reproduce
Can provide if deemed necessary.
System
Storybook 6.4.4. React
Additional context
As a work around, you can reference the parent of canvasElement. Perhaps it would be enough to document this.
Thank you for your workaround, but as you show in it, typescript will raise an error as parentElement is typed as HTMLElement | null, so not ideal. But it will work for now.
I'm not sure what the fix could be, maybe the addition of another argument property which encapsulated the portal ? Not sure if it would be possible.
Describe the bug
The
canvasElement
that gets passed to theplay
function points to theroot
div element in the iframe (<div id="root">
). However, if you are usingcreatePortal
(with a modal, for example), these elements will be appended outside of the root. This can lead to some confusion, as the elements that appears within the portal are not queryable in the typical manner.To Reproduce
Can provide if deemed necessary.
System
Storybook 6.4.4. React
Additional context
As a work around, you can reference the parent of
canvasElement
. Perhaps it would be enough to document this.The text was updated successfully, but these errors were encountered: