fix #4831
This commit is contained in:
parent
38a28d582b
commit
b0fe4f9836
1 changed files with 12 additions and 2 deletions
|
@ -22,7 +22,7 @@
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import Icon from '../icon';
|
import Icon from '../icon';
|
||||||
import { oneOf } from '../../utils/assist';
|
import { oneOf, findBrothersComponents, findComponentsUpward } from '../../utils/assist';
|
||||||
import TransferDom from '../../directives/transfer-dom';
|
import TransferDom from '../../directives/transfer-dom';
|
||||||
import Emitter from '../../mixins/emitter';
|
import Emitter from '../../mixins/emitter';
|
||||||
import ScrollbarMixins from '../modal/mixins-scrollbar';
|
import ScrollbarMixins from '../modal/mixins-scrollbar';
|
||||||
|
@ -193,7 +193,17 @@
|
||||||
if (val === false) {
|
if (val === false) {
|
||||||
this.timer = setTimeout(() => {
|
this.timer = setTimeout(() => {
|
||||||
this.wrapShow = false;
|
this.wrapShow = false;
|
||||||
this.removeScrollEffect();
|
// #4831 Check if there are any drawers left at the parent level
|
||||||
|
const brotherDrawers = findBrothersComponents(this, 'Drawer') || [];
|
||||||
|
const parentDrawers = findComponentsUpward(this, 'Drawer') || [];
|
||||||
|
|
||||||
|
const otherDrawers = [].concat(brotherDrawers).concat(parentDrawers);
|
||||||
|
|
||||||
|
const isScrollDrawer = otherDrawers.some(item => item.visible && !item.scrollable);
|
||||||
|
|
||||||
|
if (!isScrollDrawer) {
|
||||||
|
this.removeScrollEffect();
|
||||||
|
}
|
||||||
}, 300);
|
}, 300);
|
||||||
} else {
|
} else {
|
||||||
if (this.timer) clearTimeout(this.timer);
|
if (this.timer) clearTimeout(this.timer);
|
||||||
|
|
Loading…
Add table
Reference in a new issue