Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Enable using updatePageLinks on arbitrary elements (not just document). #295

Open
ejez opened this issue May 29, 2021 · 1 comment

Comments

@ejez
Copy link
Contributor

ejez commented May 29, 2021

Thanks for the work on this library.

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.

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.

@alanalvarado
Copy link

how do I use updatePageLinks?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants