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

NoticeBar 内容过短时,开启scrollable仍然触发了滚动 #628

Closed
LLwanran opened this issue Dec 24, 2019 · 5 comments
Closed

NoticeBar 内容过短时,开启scrollable仍然触发了滚动 #628

LLwanran opened this issue Dec 24, 2019 · 5 comments
Labels
discuss Need discuss

Comments

@LLwanran
Copy link

Mand Mobile Version
2.4.1

Vue Version
2.6.1

Model / OS & Browser Info
iPhone 11 iOS13.0

Recurring Steps
Slots default仅设置很短几个字

Expectant Behaviors
内容未撑开时不要滚动

Actual Behaviors
开启scrollable,无论文本长短都触发了滚动

@zouhangwithsweet
Copy link
Collaborator

我在本地复现时,只有一种情况下才出现这个问题;就是这个 slot 的内容是动态变化;请问你的使用场景是这样的吗?

@LLwanran
Copy link
Author

差不多是这样,实际需求确实是需要实时变更slot内容。
我这边测试结果是只要开启scrollable,哪怕就一个汉字,也会滚动。
我尝试将
this.overflow = content.scrollWidth > wrap.clientWidth
修改为
this.overflow = content.scrollWidth > Math.ceil(wrap.getBoundingClientRect().width);
之后结果正常

@zouhangwithsweet
Copy link
Collaborator

先升级一下 mand-mobile 版本

@LLwanran
Copy link
Author

已升级最新V2.5.6,仍然是一样,看源码好像那处逻辑对比V2.4.1并无改动

zouhangwithsweet added a commit that referenced this issue Dec 24, 2019
@zouhangwithsweet zouhangwithsweet added feature New feature or request discuss Need discuss and removed feature New feature or request labels Dec 24, 2019
@zouhangwithsweet
Copy link
Collaborator

本地仍然无法复现,但是修复了slot在动态变化下,宽度不正确的问题

xxyan0205 pushed a commit that referenced this issue Dec 26, 2019
…-bar's performance with dynamic slot content (#631)

* fix(tab-pane): fix some transition performance in some platforms

fix #627

* fix(notice-bar): fix immutable slot

fix #628

* example(notice-bar): add a new demo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss Need discuss
Projects
None yet
Development

No branches or pull requests

2 participants