zillow / react-slider

Accessible, CSS agnostic, slider component for React.
https://zillow.github.io/react-slider
MIT License
892 stars 231 forks source link

Changing # of children causes prop discrepency. #59

Closed YourDeveloperFriend closed 5 years ago

YourDeveloperFriend commented 9 years ago

This bug is apparent when you use both value and children. Example:

render: function() {
  return <ReactSlider withBars={true} value={this.state.value}>
    {this.state.labels.map(function(label) { return <div>{label}</div>; })}
  </ReactSlider>
}

If you add a value to both value and labels, neither display in the react slider. Here's a jsfiddle demonstrating the bug. The offending code is in the _or function, which relies on this.props.children, but doesn't pull the new children from the updated props in componentWillReceiveProps. Here's that same jsfiddle, with a fix, which I will include in a PR.

vinayakpatil commented 8 years ago

Why is this not merged yet? I am facing the same issue. I also have the similar fix.

vinayakpatil commented 8 years ago

@mpowaga Any update on this PR? I still see this issue, thanks!

gregtalarico commented 8 years ago

+1

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.