ant-design / ant-design-mobile

Essential UI blocks for building mobile web apps.
https://mobile.ant.design
MIT License
11.66k stars 2.41k forks source link

swiper全屏引导时如果从右侧滑出不全屏显示 #6625

Open liuyq1209 opened 6 months ago

liuyq1209 commented 6 months ago

Version of antd-mobile

5.33.2

Operating system and its version

Others

Browser and its version

No response

Sandbox to reproduce

No response

What happened?

在使用swiper时有全屏引导的案例,popup的position值为bottom时可以正常全屏引导,当position改为right时,不全屏 如图: image image

demo见:https://stackblitz.com/edit/react-vjjig6?file=demo.tsx

Relevant log output

No response

yezhonghu0503 commented 5 months ago

image 这个不是bug,Popup的宽或高是根据props.children内部的width或height来决定的,你这里没有设置width,当你设置左右弹出的时候,它的计算距离就不会是你想要的全屏,如果要全屏设置一下width或者height就好了,同样的你把height注释掉之后,你会发现从底部弹出时也不会是全屏

liuyq1209 commented 4 months ago

@yezhonghu0503 谢谢您的回复。可是当我给contentFull设置了width,这个弹层的宽度也不是固定的。我设置不同的值,弹层宽度也会随之有一个动态的值。这种情况下,如何给子元素设置宽度才能正好显示全屏呢? image