navigo icon indicating copy to clipboard operation
navigo copied to clipboard

updatePageLinks can't reach shadow DOM

Open Javarome opened this issue 2 years ago • 1 comments

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.

Javarome avatar Sep 22 '21 11:09 Javarome

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.

sugacube avatar Dec 20 '23 10:12 sugacube