navigo
navigo copied to clipboard
updatePageLinks can't reach shadow DOM
When using web components that include links in their shadow DOM, document.querySelectorAll()
won't find navigo links selectors.
A workaround could be to allow the updatePageLinks
API to take root elements to look from:
updatePageLinks(roots = [document]) {
findLinks(roots)
// etc.
}
That way, we could allow shadow roots to be updated by providing them as roots to update.
I just hit this same issue.
The workaround I found is to have <a>
element (or any link) in the shadow dom explicitly call <a @click= router.navigate()>
I may like this even better than having to call updatePageLinks() explicitly whenever dom is updated.