mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-24 03:39:01 +08:00
Only allow left mouse button to open links (#3777)
* Only allow left mouse button to open links * fix lint errors
This commit is contained in:
parent
da5c5864ed
commit
dd3c7618ac
@ -11,6 +11,10 @@ export function clickHandler(options: ClickHandlerOptions): Plugin {
|
||||
key: new PluginKey('handleClickLink'),
|
||||
props: {
|
||||
handleClick: (view, pos, event) => {
|
||||
if (event.button !== 1) {
|
||||
return false
|
||||
}
|
||||
|
||||
const attrs = getAttributes(view.state, options.type.name)
|
||||
const link = (event.target as HTMLElement)?.closest('a')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user