From dd0990ab8ec1924ad19122a2ceafd234210b499f Mon Sep 17 00:00:00 2001 From: js87zz Date: Fri, 6 Aug 2021 14:46:50 +0900 Subject: [PATCH 1/2] fix: wrong selection layer position in table popup body --- .../src/ui/components/toolbar/tablePopupBody.ts | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/apps/editor/src/ui/components/toolbar/tablePopupBody.ts b/apps/editor/src/ui/components/toolbar/tablePopupBody.ts index a5ad0798be..29a83562d4 100644 --- a/apps/editor/src/ui/components/toolbar/tablePopupBody.ts +++ b/apps/editor/src/ui/components/toolbar/tablePopupBody.ts @@ -106,18 +106,16 @@ export class TablePopupBody extends Component { return range; } - mounted() { - const { left, top } = this.refs.tableEl.getBoundingClientRect(); - - this.offsetRect = { - left: window.pageXOffset + left, - top: window.pageYOffset + top, - }; - } - updated() { if (!this.props.show) { this.setState({ colIdx: -1, rowIdx: -1 }); + } else if (this.state.colIdx === -1 && this.state.rowIdx === -1) { + const { left, top } = this.refs.tableEl.getBoundingClientRect(); + + this.offsetRect = { + left: window.pageXOffset + left, + top: window.pageYOffset + top, + }; } } From b9193f054f25a17f1d4a20def6a950b1030dc9aa Mon Sep 17 00:00:00 2001 From: js87zz Date: Tue, 10 Aug 2021 10:37:48 +0900 Subject: [PATCH 2/2] fix: change meta mark to calculated property in custom block --- apps/editor/src/markdown/plugins/helper/markInfo.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/editor/src/markdown/plugins/helper/markInfo.ts b/apps/editor/src/markdown/plugins/helper/markInfo.ts index 536a9645fa..08472ddf88 100644 --- a/apps/editor/src/markdown/plugins/helper/markInfo.ts +++ b/apps/editor/src/markdown/plugins/helper/markInfo.ts @@ -190,7 +190,11 @@ function customBlock(node: MdNode, start: MdPos, end: MdPos) { if (info) { marks.push( - markInfo(addOffsetPos(start, 2), addOffsetPos(start, syntaxLength + info.length), META) + markInfo( + addOffsetPos(start, syntaxEnd), + addOffsetPos(start, syntaxLength + info.length), + META + ) ); }