Closed sag1v closed 1 year ago
@ghengeveld Would appreciate you take on this :)
Seems reasonable.
@thafryer Should we schedule this?
Great 👍 you want me to create a PR?
@sag1v Feel free to go ahead and open a PR!
Please change it to rootElement
though, so it's more clear an element is expected (not a CSS selector).
@thafryer @ghengeveld see #65 PR
@thafryer @ghengeveld Hi, any chance we can move forward with this?
:rocket: Issue was released in v2.1.0
:rocket:
:rocket: Issue was released in v2.1.0
:rocket:
Currently the lib decide about what is the root element to use for the query see this line.
The issue with this approach, is that sometimes the elements we want to query are rendered outside of this "root" element, E.g: Modals, popovers and portals in general that are attached to the
document.body
.I don't see any way to work around this issue with the current implementation, so I'm suggesting an additional API that will allow consumers to pass a root element:
For example:
This can be done in the applyParameter function, we just need to take in account the
root
parameter and have a fallback to whatever we have today in case the consumer didn't pass it.@ghengeveld WDYT?