mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-12-23 23:02:08 +03:00
Lexical: Merged custom table node code
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import {EditorUiElement} from "../core";
|
||||
import {$createTableNodeWithDimensions} from "@lexical/table";
|
||||
import {CustomTableNode} from "../../../nodes/custom-table";
|
||||
import {$insertNewBlockNodeAtSelection} from "../../../utils/selection";
|
||||
import {el} from "../../../utils/dom";
|
||||
|
||||
@@ -78,7 +77,7 @@ export class EditorTableCreator extends EditorUiElement {
|
||||
const colWidths = Array(columns).fill(targetColWidth + 'px');
|
||||
|
||||
this.getContext().editor.update(() => {
|
||||
const table = $createTableNodeWithDimensions(rows, columns, false) as CustomTableNode;
|
||||
const table = $createTableNodeWithDimensions(rows, columns, false);
|
||||
table.setColWidths(colWidths);
|
||||
$insertNewBlockNodeAtSelection(table);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user