Open mdawar opened 1 year ago
You could set the "ref" attribute on the Portal
like so:
<Portal ref={x => x.style.display = "contents"} />
This will make the div
behave like it wasn't even there (At least visually).
You can even put in a separate method to avoid repeating it every time:
const hidePortalDiv: (x: HTMLElement) => void = x => x.style.display = "contents";
// ...
<Portal ref={hidePortalDiv} />
// ...
<Portal ref={hidePortalDiv} />
Describe the bug
I'm using the
Portal
component for a toast element where I noticed that the wrapperdiv
element is messing up the styles of the elements.I know that this
div
is required, but is it possible to at least add the ability to add theclass
attribute for this element for these edge cases?Your Example Website or App
https://stackblitz.com/edit/solidjs-templates-cshflq?file=src%2FApp.tsx
Steps to Reproduce the Bug or Issue
div
the layout will be fixedExpected behavior
I expected to at least be able to add the
class
attribute to thePortal
's wrapperdiv
. I would also be great if we can pass any attributes down to thediv
element.Screenshots or Videos
No response
Platform
Additional context
Sorry if this issue is too specific, feel free to close it if it's out of scope.