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
Just started exploring navigo, and found how data-navigo and updatePageLinks can greatly simplify adding internal app links. However they become useless when the app is using web components, because querying for the links is hardcoded to document.querySelectorAll which does not traverse the shadow dom.
I suggest adding an optional argument element (with document as default) to the functions findLinks and updatePageLinks. This argument will be the subject element where the links are searched for. (element.querySelectorAll instead of document.querySelectorAll.)
This simple change will allow for more flexible use of this functionality. Web components are increasingly being adopted.
Thanks for the work on this library.
Just started exploring navigo, and found how
data-navigo
andupdatePageLinks
can greatly simplify adding internal app links. However they become useless when the app is using web components, because querying for the links is hardcoded todocument.querySelectorAll
which does not traverse the shadow dom.I suggest adding an optional argument
element
(withdocument
as default) to the functionsfindLinks
andupdatePageLinks
. This argument will be the subject element where the links are searched for. (element.querySelectorAll
instead ofdocument.querySelectorAll
.)This simple change will allow for more flexible use of this functionality. Web components are increasingly being adopted.
Another option is to make use of https://github.com/Georgegriff/query-selector-shadow-dom to allow traversing all the shadow doms, even if they are deeply nested.
Thank you in advance.
The text was updated successfully, but these errors were encountered: