Skip to content

Commit

Permalink
fix(prosemirror): undoable inputrules
Browse files Browse the repository at this point in the history
  • Loading branch information
ap0nia committed Oct 24, 2024
1 parent a1262cf commit 4eb0faf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/prose/src/toolkit/input-rules/custom-input-rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ function run(view: EditorView, from: number, to: number, text: string, rules: In
).handler(state, match, from - (match[0].length - text.length), to)
if (!tr)
continue
view.dispatch(tr.setMeta(plugin, { transform: tr, from, to, text }))
// @ts-expect-error Internal property that should be in the class; only relevant if explicitly false.
if (rules[i]?.undoable !== false)
tr.setMeta(plugin, { transform: tr, from, to, text })
view.dispatch(tr)
return true
}
return false
Expand Down

0 comments on commit 4eb0faf

Please sign in to comment.