fix: require double-click to open editor links#259
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e67567c25d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| event.preventDefault(); | ||
|
|
||
| // Block single-click navigation for links in the editor. | ||
| return true; |
There was a problem hiding this comment.
Let ProseMirror handle link single-click selection
This handler consumes every anchor click by returning true, which in ProseMirror means the click is fully handled and downstream/default editor click logic will not run. That blocks normal caret/selection updates when users single-click linked text, so they can no longer reliably place the cursor in a link to edit it (a regression in editing behavior even though navigation is blocked).
Useful? React with 👍 / 👎.

Summary
Implementation
Updated
useBlockEditorto pass custom_tiptapOptions.editorPropshandlers:a[href]from the event target.handleClickto prevent default navigation for anchors on single click.handleDoubleClickto open the link explicitly withwindow.openusingnoopener,noreferrer.Verification
Verified locally with type-checking.
pnpm --filter @acme/web typecheckNotes