erikringsmuth / app-router

Router for Web Components
https://erikringsmuth.github.io/app-router/
MIT License
610 stars 83 forks source link

DOM exception is thrown in Safari when using Polymer 1.x in Shady DOM mode #154

Closed web-padawan closed 7 years ago

web-padawan commented 7 years ago

This happens when scrollToHash is called in Safari 9.1, when using webcomponents-lite.js which doesn't shim /deep/ selector. The reason is this code:

hashElement = document.querySelector('html /deep/ ' + hash) 

I'll send a PR with some kind of workaround. In the future, I suggest replacing this logic by dispatching an event (this would be a breaking change).