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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user