diff --git a/src/index.js b/src/index.js index a04c2ec..18ef167 100644 --- a/src/index.js +++ b/src/index.js @@ -117,7 +117,7 @@ function delegateLinkHandler(e) { let t = e.target; do { - if (t.localName === 'a' && t.getAttribute('href')) { + if (t.localName === 'a' && t.getAttribute('href') && !t.isContentEditable) { if (t.hasAttribute('data-native') || t.hasAttribute('native')) return; // if link is handled by the router, prevent browser defaults if (routeFromLink(t)) { diff --git a/test/dom.test.js b/test/dom.test.js index ad28931..e373c63 100644 --- a/test/dom.test.js +++ b/test/dom.test.js @@ -118,6 +118,25 @@ describe('dom', () => { expect(onChange).not.toHaveBeenCalled(); expect(location.href).toContain('#foo'); }); + + it('should not intercept links inside contenteditable', () => { + let onChange = jasmine.createSpy(); + mount( +