Skip to content

Commit 013a2c2

Browse files
committed
fix: rich text table error inside another table
1 parent 691e74e commit 013a2c2

File tree

5 files changed

+10
-4
lines changed

5 files changed

+10
-4
lines changed

packages/pluggableWidgets/rich-text-web/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9+
### Fixed
10+
11+
- We fixed an issue where rich text table failed to properly functions if the widget is placed inside a table structure.
12+
913
## [4.8.0] - 2025-07-01
1014

1115
### Added

packages/pluggableWidgets/rich-text-web/src/utils/formats/quill-table-better/quill-table-better.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ class Table extends Module {
148148

149149
handleMousedown(e: MouseEvent) {
150150
this.tableSelect?.hide(this.tableSelect.root);
151-
const table = (e.target as Element).closest("table");
151+
const table = (e.target as Element).closest("table.ql-table-better");
152152
if (!table) return this.hideTools();
153153
this.cellSelection.handleMousedown(e);
154154
this.cellSelection.setDisabled(true);

packages/pluggableWidgets/rich-text-web/src/utils/formats/quill-table-better/ui/cell-selection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ class CellSelection {
304304

305305
handleMousedown(e: MouseEvent) {
306306
this.clearSelected();
307-
const table = (e.target as Element).closest("table");
307+
const table = (e.target as Element).closest("table.ql-table-better");
308308
if (!table) return;
309309
this.tableBetter.tableMenus.destroyTablePropertiesForm();
310310
const startTd = (e.target as Element).closest("td");

packages/pluggableWidgets/rich-text-web/src/utils/formats/quill-table-better/ui/operate-line.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ class OperateLine {
180180
}
181181

182182
handleMouseMove(e: MouseEvent) {
183-
const tableNode = (e.target as Element).closest("table");
183+
const tableNode = (e.target as Element).closest("table.ql-table-better");
184+
if (!tableNode) return;
184185
const cellNode = (e.target as Element).closest("td");
185186
const mousePosition = {
186187
clientX: e.clientX,

packages/pluggableWidgets/rich-text-web/src/utils/formats/quill-table-better/ui/table-menus.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,8 @@ class TableMenus {
607607
}
608608

609609
handleClick(e: MouseEvent) {
610-
const table = (e.target as Element).closest("table");
610+
const table = (e.target as Element).closest("table.ql-table-better");
611+
if (!table) return;
611612
this.prevList && this.prevList.classList.add("ql-hidden");
612613
this.prevTooltip && this.prevTooltip.classList.remove("ql-table-tooltip-hidden");
613614
this.prevList = null;

0 commit comments

Comments
 (0)