Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SwipeAction支持父元素宽度自适应 #1818

Open
zhang0ZGC opened this issue Sep 9, 2024 · 1 comment
Open

SwipeAction支持父元素宽度自适应 #1818

zhang0ZGC opened this issue Sep 9, 2024 · 1 comment

Comments

@zhang0ZGC
Copy link

这个功能解决了什么问题?

SwipeAction所在容器宽度不是100vw的情况下,能够自适应容器宽度

你期望的功能是怎样的?

SwipeAction所在容器宽度不是100vw的情况下,能够自适应容器宽度,而不是始终为屏幕宽度

补充信息

<View>
  <View style={{margin: '10px', borderRadius: '6px', background: '#fff'}}>
    <AtSwipeAction
      options={[  {text: '删除', style: {backgroundColor: '#E62D09'}} ]}
      onClick={(e) => console.log(e)}
    >
      <View style={{height: 64}}>Width Should be  355px</View>
    </AtSwipeAction>
  </View>
</View>

在一些场景下,父元素是一个卡片样式的元素,它有外边距,因此父元素的宽度是不满100vw的,最近升级到TaroUI3.x,我注意到,在TaroUI2.x中,SwitchAction 会自动撑满父元素宽度的,但是3.x中,areaWidth 的值为 systemInfo.windowWidth,即屏幕宽度,这导致了 SwitchAction 的子元素宽度超出了父元素卡片的宽度在UI呈现上溢出了

Copy link

taro-ui-bot bot commented Sep 9, 2024

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant