fix: allow deleting last character in headings (#1954)
The copy-link decoration widget (contentEditable="false") injected inside headings prevented browsers from deleting the last remaining character via Backspace or Delete keys. Only show the widget when the heading has more than one character of content.
This commit is contained in:
parent
0aeaa43112
commit
03a70d768a
1 changed files with 1 additions and 1 deletions
|
|
@ -20,7 +20,7 @@ export const Heading = TiptapHeading.extend<TiptapHeadingOptions>({
|
|||
const { doc } = state;
|
||||
|
||||
doc.descendants((node, pos) => {
|
||||
if (node.type.name === "heading" && node.content.size > 0) {
|
||||
if (node.type.name === "heading" && node.content.size > 1) {
|
||||
const deco = Decoration.widget(
|
||||
pos + node.nodeSize - 1,
|
||||
() => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue