Skip to content

Commit

Permalink
prevent opening link when clicking on selection containing a link (#4346
Browse files Browse the repository at this point in the history
)

* prevent opening link when clicking on selection containing a link

* Fix lint err
  • Loading branch information
aldinezi authored Sep 4, 2023
1 parent 586e3c4 commit 73202a0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/extension-link/src/helpers/clickHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ export function clickHandler(options: ClickHandlerOptions): Plugin {
return false
}

const eventTarget = event.target as HTMLElement

if (eventTarget.nodeName !== 'A') {
return false
}

const attrs = getAttributes(view.state, options.type.name)
const link = (event.target as HTMLLinkElement)

Expand Down

0 comments on commit 73202a0

Please sign in to comment.