Skip to content

Commit e044698

Browse files
committed
bug fixed #471
1 parent 7caf2eb commit e044698

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

packages/ve-table/src/editor/edit-input.jsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,9 @@ export default {
179179
parentRendered: {
180180
handler: function (val) {
181181
if (val) {
182+
// fixed #471
183+
this.setTableEl();
184+
182185
// add table container scroll hook
183186
this.hooks.addHook(
184187
HOOKS_NAME.TABLE_CONTAINER_SCROLL,
@@ -197,7 +200,6 @@ export default {
197200
);
198201
// add table size change hook
199202
this.hooks.addHook(HOOKS_NAME.TABLE_SIZE_CHANGE, () => {
200-
this.setTableEl();
201203
this.setTextareaPosition();
202204
});
203205
}
@@ -239,8 +241,10 @@ export default {
239241
methods: {
240242
// set table element
241243
setTableEl() {
242-
const tableEl = this.$el.previousElementSibling;
243-
this.tableEl = tableEl;
244+
this.$nextTick(() => {
245+
const tableEl = this.$el.previousElementSibling;
246+
this.tableEl = tableEl;
247+
});
244248
},
245249

246250
// set cell element

0 commit comments

Comments
 (0)