Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

fix(nc-gui): Uncaught RangeError: Selection passed to setSelection must point at the current document

Ramesh Manede4c41e23159
diff --git a/packages/nc-gui/helpers/tiptap-markdown/extensions/marks/link.ts b/packages/nc-gui/helpers/tiptap-markdown/extensions/marks/link.ts
index e251cc322a..2d53fe1d2a 100644
--- a/packages/nc-gui/helpers/tiptap-markdown/extensions/marks/link.ts
+++ b/packages/nc-gui/helpers/tiptap-markdown/extensions/marks/link.ts
@@ -100,7 +100,7 @@ export const Link = TiptapLink.extend<LinkOptions>({
if (!isAtEndOfLink) return false
// βœ… Insert space and then remove ALL marks
- const tr = state.tr.insertText(' ', $to.pos).setSelection(state.selection)
+ const tr = state.tr.insertText(' ', $to.pos)
this.editor.view.dispatch(tr)
this.editor.commands.unsetAllMarks() // This clears bold, italic, underline, link, etc.