Commit b0fe4f98364383645199c9ae5d1daaeeb7eb24ad

Authored by 梁灏
1 parent 38a28d58

fix #4831

Showing 1 changed file with 12 additions and 2 deletions   Show diff stats
src/components/drawer/drawer.vue
@@ -22,7 +22,7 @@ @@ -22,7 +22,7 @@
22 </template> 22 </template>
23 <script> 23 <script>
24 import Icon from '../icon'; 24 import Icon from '../icon';
25 - import { oneOf } from '../../utils/assist'; 25 + import { oneOf, findBrothersComponents, findComponentsUpward } from '../../utils/assist';
26 import TransferDom from '../../directives/transfer-dom'; 26 import TransferDom from '../../directives/transfer-dom';
27 import Emitter from '../../mixins/emitter'; 27 import Emitter from '../../mixins/emitter';
28 import ScrollbarMixins from '../modal/mixins-scrollbar'; 28 import ScrollbarMixins from '../modal/mixins-scrollbar';
@@ -193,7 +193,17 @@ @@ -193,7 +193,17 @@
193 if (val === false) { 193 if (val === false) {
194 this.timer = setTimeout(() => { 194 this.timer = setTimeout(() => {
195 this.wrapShow = false; 195 this.wrapShow = false;
196 - this.removeScrollEffect(); 196 + // #4831 Check if there are any drawers left at the parent level
  197 + const brotherDrawers = findBrothersComponents(this, 'Drawer') || [];
  198 + const parentDrawers = findComponentsUpward(this, 'Drawer') || [];
  199 +
  200 + const otherDrawers = [].concat(brotherDrawers).concat(parentDrawers);
  201 +
  202 + const isScrollDrawer = otherDrawers.some(item => item.visible && !item.scrollable);
  203 +
  204 + if (!isScrollDrawer) {
  205 + this.removeScrollEffect();
  206 + }
197 }, 300); 207 }, 300);
198 } else { 208 } else {
199 if (this.timer) clearTimeout(this.timer); 209 if (this.timer) clearTimeout(this.timer);