1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2026-01-03 23:42:28 +03:00

Lexical: Further improvements to table selection and captions

- Fixed errors with selection and range handling due to captions
  existing.
- Updated TableNode change handling to update existing DOM instead of
  re-creating, which avoids breaking an attached selection helper.
  - To support, Added function to handle node change detection and apply
    relevant dom updates for common properties.
This commit is contained in:
Dan Brown
2025-05-28 22:47:39 +01:00
parent d9ea52522e
commit b862f12a50
6 changed files with 84 additions and 21 deletions

View File

@@ -916,14 +916,14 @@ export function getTable(tableElement: HTMLElement): TableDOMTable {
domRows.length = 0;
while (currentNode != null) {
const nodeMame = currentNode.nodeName;
const nodeName = currentNode.nodeName;
if (nodeMame === 'COLGROUP') {
if (nodeName === 'COLGROUP' || nodeName === 'CAPTION') {
currentNode = currentNode.nextSibling;
continue;
}
if (nodeMame === 'TD' || nodeMame === 'TH') {
if (nodeName === 'TD' || nodeName === 'TH') {
const elem = currentNode as HTMLElement;
const cell = {
elem,