Skip to content

Commit c6faf94

Browse files
author
zhiyang
committed
Dialog: ignore width when fullsreen is true
1 parent 156fccd commit c6faf94

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

packages/dialog/src/component.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,11 @@
129129
computed: {
130130
style() {
131131
let style = {};
132-
if (this.width) {
133-
style.width = this.width;
134-
}
135132
if (!this.fullscreen) {
136133
style.marginTop = this.top;
134+
if (this.width) {
135+
style.width = this.width;
136+
}
137137
}
138138
return style;
139139
}

test/unit/specs/dialog.spec.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,10 @@ describe('Dialog', () => {
134134
};
135135

136136
it('fullscreen', () => {
137-
vm = getDialogVm('fullscreen');
138-
expect(vm.$el.querySelector('.el-dialog').classList.contains('is-fullscreen')).to.true;
137+
vm = getDialogVm('fullscreen width="40%"');
138+
const dialogEl = vm.$el.querySelector('.el-dialog');
139+
expect(dialogEl.classList.contains('is-fullscreen')).to.true;
140+
expect(dialogEl.style.width).to.be.empty;
139141
});
140142

141143
it('top', () => {

0 commit comments

Comments
 (0)