Skip to content

Commit

Permalink
Revert "Image: Fix shortcut key not work at second time issue (#18983) (
Browse files Browse the repository at this point in the history
#19156)"

This reverts commit f3c76ee.
  • Loading branch information
luckyCao authored Apr 13, 2020
1 parent f3c76ee commit 97c68f3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/image/src/main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
:style="imageStyle"
:class="{ 'el-image__inner--center': alignCenter, 'el-image__preview': preview }">
<template v-if="preview">
<image-viewer :z-index="zIndex" :initial-index="imageIndex" v-if="showViewer" :on-close="closeViewer" :url-list="previewSrcList"/>
<image-viewer :z-index="zIndex" :initial-index="imageIndex" v-show="showViewer" :on-close="closeViewer" :url-list="previewSrcList"/>
</template>
</div>
</template>
Expand Down
5 changes: 3 additions & 2 deletions test/unit/specs/image.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,11 @@ describe('Image', () => {
vm.$el.querySelector('.el-image__inner').click();
await wait();

expect(vm.$el.querySelector('.el-image-viewer__wrapper')).to.exist;
const $wrapper = vm.$el.querySelector('.el-image-viewer__wrapper');
expect($wrapper).to.exist;
vm.$el.querySelector('.el-image-viewer__close').click();
await wait(1000);
expect(vm.$el.querySelector('.el-image-viewer__wrapper')).to.not.exist;
expect($wrapper.style.display).to.equal('none');
});
});

0 comments on commit 97c68f3

Please sign in to comment.