mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(ActionSheet): safe-area-inset-bottom not work (#8085)
This commit is contained in:
parent
c0c2e8e125
commit
9735369e99
@ -157,6 +157,7 @@ export default createComponent({
|
|||||||
class={bem()}
|
class={bem()}
|
||||||
round={props.round}
|
round={props.round}
|
||||||
position="bottom"
|
position="bottom"
|
||||||
|
safeAreaInsetBottom={props.safeAreaInsetBottom}
|
||||||
{...{
|
{...{
|
||||||
...pick(props, popupPropKeys),
|
...pick(props, popupPropKeys),
|
||||||
'onUpdate:show': onUpdateShow,
|
'onUpdate:show': onUpdateShow,
|
||||||
|
@ -11,7 +11,7 @@ exports[`should render default slot correctly 1`] = `
|
|||||||
</div>
|
</div>
|
||||||
</transition-stub>
|
</transition-stub>
|
||||||
<transition-stub>
|
<transition-stub>
|
||||||
<div class="van-popup van-popup--round van-popup--bottom van-action-sheet">
|
<div class="van-popup van-popup--round van-popup--bottom van-popup--safe-area-inset-bottom van-action-sheet">
|
||||||
<div class="van-action-sheet__header">
|
<div class="van-action-sheet__header">
|
||||||
Title
|
Title
|
||||||
<i class="van-badge__wrapper van-icon van-icon-cross van-action-sheet__close">
|
<i class="van-badge__wrapper van-icon van-icon-cross van-action-sheet__close">
|
||||||
|
@ -217,3 +217,22 @@ test('should emit click-overlay event and closed after clicking the overlay', ()
|
|||||||
expect(wrapper.emitted('update:show')[0][0]).toEqual(false);
|
expect(wrapper.emitted('update:show')[0][0]).toEqual(false);
|
||||||
expect(onClickOverlay).toHaveBeenCalledTimes(1);
|
expect(onClickOverlay).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('should allow to control safe-area with safe-area-inset-bottom prop', async () => {
|
||||||
|
const wrapper = mount(ActionSheet, {
|
||||||
|
props: {
|
||||||
|
show: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(wrapper.find('.van-action-sheet').classes()).toContain(
|
||||||
|
'van-popup--safe-area-inset-bottom'
|
||||||
|
);
|
||||||
|
|
||||||
|
await wrapper.setProps({
|
||||||
|
safeAreaInsetBottom: false,
|
||||||
|
});
|
||||||
|
expect(wrapper.find('.van-action-sheet').classes()).not.toContain(
|
||||||
|
'van-popup--safe-area-inset-bottom'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
@ -74,9 +74,7 @@ test('should have safe-area-inset-top class when using safe-area-inset-top prop'
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(
|
expect(wrapper.classes()).toContain('van-nav-bar--safe-area-inset-top');
|
||||||
wrapper.find('.van-nav-bar--safe-area-inset-top').exists()
|
|
||||||
).toBeTruthy();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should change z-index when using z-index prop', () => {
|
test('should change z-index when using z-index prop', () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user