Skip to content

Commit

Permalink
Merge pull request #69 from Patternslib/fix-adding-columns
Browse files Browse the repository at this point in the history
Fix adding columns
  • Loading branch information
thet authored Aug 20, 2024
2 parents d0ba727 + ad5e986 commit 58d6c94
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/extensions/fixed-paragraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ export const factory = () => {
];
},

addProseMirrorPlugins() {
// NOTE: Deactivate whole ProseMirror plugin while registering the
// extension as it is used in the trailing-node extension.
// Why is it deactivated? See `TODO` comment below.
DEACTIVATED__addProseMirrorPlugins() {
return [
new Plugin({
filterTransaction(transaction, state) {
Expand All @@ -50,6 +53,8 @@ export const factory = () => {
const map = transaction.mapping.maps[index];
const oldStart = map.ranges[0];
const oldEnd = map.ranges[0] + map.ranges[1];
// TODO: This code breaks for tables when adding
// columns left/right within a table cell.
state.doc.nodesBetween(oldStart, oldEnd, (node) => {
if (node.type.name === "fixed-paragraph") {
result = false;
Expand Down
7 changes: 7 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@
:focus {
outline: 3px solid red;
}

#tiptap-external-toolbar {
position: sticky;
top: 0;
background: white;
z-index: 1000;
}
</style>
</head>
<body>
Expand Down

0 comments on commit 58d6c94

Please sign in to comment.