Skip to content

[Bug Report] notice-bar text内容由长文本改为短文本时仍旧触发滚动效果 #5966

@864989019

Description

@864989019

重现链接

先将text属性设置为“一段超长会导致滚动的文本一段超长会导致滚动的文本”
再将text属性更新为“短文本” 时 组件不会停止自动滚动

Vant Weapp 版本

1.11.7

描述一下你遇到的问题。

先将text属性设置为“一段超长会导致滚动的文本一段超长会导致滚动的文本”
再将text属性更新为“短文本” 时 组件不会停止自动滚动

notice-bar组件 init方法

                    if (scrollable || wrapRect.width < contentRect.width) {
                        _this.initAnimation(wrapRect.width, contentRect.width);
                        _this.scroll(true);
                    }

处 应添加else{_this.scroll(false);}(?)

重现步骤

先将text属性设置为“一段超长会导致滚动的文本一段超长会导致滚动的文本”
再将text属性更新为“短文本” 时 组件不会停止自动滚动

设备/浏览器

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions