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

SliderIndex 设置为 0 时没有反应 #4

Closed
siwei-lu opened this issue Aug 3, 2018 · 3 comments
Closed

SliderIndex 设置为 0 时没有反应 #4

siwei-lu opened this issue Aug 3, 2018 · 3 comments
Labels
bug Something isn't working

Comments

@siwei-lu
Copy link

siwei-lu commented Aug 3, 2018

组件受控时,sliderIndex 设置为 0 的时候,不会触发卡片切换,但是非 0 值可以。

@siwei-lu
Copy link
Author

siwei-lu commented Aug 3, 2018

看了下源码,应该是
if (nextProps.sliderIndex && nextProps.sliderIndex !== this.state.sliderIndex) { this.setState({ sliderIndex: nextProps.sliderIndex }, ) }
这个地方的判断有问题,把 0 当成 false 了

@951565664
Copy link
Owner

我看到了你的pull request了。。bug是那个地方导致的,但是turn函数里面还有一个bug。。。我自己改了,并且调整了下结构。省得一个bug改两个地方。另外还修改了受控情况下,手动点击分页符,会导致不受控的情况发生。

@951565664
Copy link
Owner

4.2.0版本已经修改。

@951565664 951565664 added the bug Something isn't working label Oct 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants