Skip to content

Commit

Permalink
[Dialog]修复组件在一些场景下销毁时没有删除body上的t-dialog-lock类的问题 (#1766)
Browse files Browse the repository at this point in the history
* fix(dialog): 修复参数footer为false时,footer节点还渲染问题

* chore: fix version

* fix(dialog): 修复组件在某种场景下销毁时没有删除body上的t-dialog-lock类的问题

* feat: update snapshots

Co-authored-by: Uyarn <[email protected]>
  • Loading branch information
huangpiqiao and uyarn authored Nov 10, 2022
1 parent f64fa61 commit a57a69d
Show file tree
Hide file tree
Showing 3 changed files with 1,196 additions and 1,191 deletions.
6 changes: 5 additions & 1 deletion src/dialog/dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export default mixins(ActionMixin, getConfigReceiverMixins<Vue, DialogConfig>('d
(document.activeElement as HTMLElement).blur();
} else {
document.body.style.cssText = '';
removeClass(document.body, `${this.componentName}--lock`);
this.removeBodyLockClass();
}
// 多个dialog同时存在时使用esc关闭异常 (#1209)
this.storeUid(value);
Expand Down Expand Up @@ -194,6 +194,7 @@ export default mixins(ActionMixin, getConfigReceiverMixins<Vue, DialogConfig>('d

beforeDestroy() {
this.addKeyboardEvent(false);
this.removeBodyLockClass();
},

directives: {
Expand Down Expand Up @@ -425,6 +426,9 @@ export default mixins(ActionMixin, getConfigReceiverMixins<Vue, DialogConfig>('d
</div>
);
},
removeBodyLockClass() {
removeClass(document.body, `${this.componentName}--lock`);
},
},

render() {
Expand Down
Loading

0 comments on commit a57a69d

Please sign in to comment.