Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

Commit

Permalink
Don't allow clicking the link in the editor
Browse files Browse the repository at this point in the history
  • Loading branch information
tiberiuichim committed Sep 18, 2021
1 parent 3035948 commit 617d19c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/editor/plugins/SimpleLink/render.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ export const LinkElement = (props) => {
return mode === 'view' ? (
<ViewLink {...(element.data || {})}>{children}</ViewLink>
) : (
<a {...attributes} className="slate-editor-link" href={element.data?.url}>
<a
{...attributes}
className="slate-editor-link"
href={element.data?.url}
onClick={(e) => e.preventDefault()}
>
{Array.isArray(children)
? children.map((child, i) => {
if (child?.props?.decorations) {
Expand Down

0 comments on commit 617d19c

Please sign in to comment.