Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/sandbox-hooks/url-listeners.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ function pathWithHash(location) {
return `${location.pathname}${location.hash}`;
}

function isInsiveVue(el) {
if (el === document.body) return false
return el.__vue__ || el._vnode || isInsideVue(el.parentElement)
}

export default function setupHistoryListeners() {
function handleMessage(data, source) {
if (source) {
Expand Down Expand Up @@ -109,7 +114,7 @@ export default function setupHistoryListeners() {
const el = ev.target;
if (
el.nodeName === 'A' &&
!el.__vue__ && // workaround for vue-router <router-link>
!isInsideVue(el) && // workaround for vue-router <router-link>
el.href.indexOf('#') !== -1 &&
el.href.substr(-1) !== '#'
) {
Expand Down