You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With column resizing enabled, highlight two or more cells.
Without releasing your left mouse button and while your cursor is close enough to a column border to trigger a resize cursor, press the Delete key to delete the cells.
Observe the following error:
Uncaught (in promise) TypeError: Cannot read property 'type' of undefined
at computeMap (index.es.js:273)
at Function.get (index.es.js:268)
at handleDecorations (index.es.js:3074)
at Plugin.decorations (index.es.js:2811)
at eval (index.es.js:6526)
at EditorView.someProp (index.es.js:6806)
at viewDecorations (index.es.js:6525)
at EditorView.updateStateInner (index.es.js:6682)
at EditorView.updateState (index.es.js:6652)
at Editor.dispatchTransaction (tiptap.esm.js:1176)
This is because pluginState.activeHandle is not being cleared/reset to -1 when its corresponding node is removed. Also because handleDecorations in columnresizing.js is not checking that table is not null/undefined before passing it to TableMap.get(table).
In action:
The text was updated successfully, but these errors were encountered:
function handleDecorations(state, cell) {
let decorations = [];
let $cell = state.doc.resolve(cell);
let table = $cell.node(-1);
if (!table) {
return DecorationSet.empty;
}
let map = TableMap.get(table);
let start = $cell.start(-1);
let col = map.colCount($cell.pos - start) + $cell.nodeAfter.attrs.colspan;
for (let row = 0; row < map.height; row++) {
let index = col + row * map.width - 1;
// For positions that are have either a different cell or the end
// of the table to their right, and either the top of the table or
// a different cell above them, add a decoration
if (
(col == map.width || map.map[index] != map.map[index + 1]) &&
(row == 0 || map.map[index - 1] != map.map[index - 1 - map.width])
) {
let cellPos = map.map[index];
let pos = start + cellPos + table.nodeAt(cellPos).nodeSize - 1;
let dom = document.createElement("div");
dom.className = "column-resize-handle";
decorations.push(Decoration.widget(pos, dom));
}
}
return DecorationSet.create(state.doc, decorations);
}
Delete
key to delete the cells.This is because
pluginState.activeHandle
is not being cleared/reset to-1
when its corresponding node is removed. Also becausehandleDecorations
incolumnresizing.js
is not checking thattable
is not null/undefined before passing it toTableMap.get(table)
.In action:
The text was updated successfully, but these errors were encountered: