fix(Dialog): Solutions to keep the content within the container #4556
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
设备
iPhone
VantWeapp ��本
1.9.1
基础库版本
2.20.0
问题描述
调用 Dialog.confirm flex布局子元素宽度超出父元素问题
问题只在使用 小程序基础库 v2.8.3 以上的小程序上出现
原因分析
应该是微信浏览器提供的user agent stylesheet的button 默认width 导致flex子元素宽度过大 超出flex父元素时,设置flex:1并不能限制flex子元素的尺寸
解决方案
限制子元素原本宽度,设置width属性 ,强行设置原本宽度为0,让子元素盒模型宽度完全由flex: 1这个属性来分配