Skip to content

Commit

Permalink
Merge pull request #2771 from KorovinQuantori/main
Browse files Browse the repository at this point in the history
Fix: insert table in paragraph
  • Loading branch information
zbeyens authored Nov 27, 2023
2 parents 967ac57 + 089e4bd commit e656644
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/dirty-insects-obey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@udecode/plate-table': patch
---

Fixed table insertion inside text nodes
4 changes: 4 additions & 0 deletions packages/table/src/withInsertFragmentTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ export const withInsertFragmentTable = <

return;
}
} else if (fragment.length === 1 && fragment[0].type === ELEMENT_TABLE) {
// needed to insert as node, otherwise it will be inserted as text
editor.insertNode(fragment[0]);
return;
}
}

Expand Down

0 comments on commit e656644

Please sign in to comment.