zillow / react-slider

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

Upgrade from 0.3.4 to 0.4.1 results in handles not moving #28

Closed eriklharper closed 9 years ago

eriklharper commented 9 years ago

Did a simple upgrade of react-slider and now my handles are not moveable and by default they are stuck all the way on the left side, where they should be set in the middle as before when I was using 0.3.4.

Here's what my usage looks like (in jsx):

<ReactSlider
  className="range-slider"
  name={this.props.name}
  min={10}
  max={70}
  onChange={this.changeValue}
  defaultValue={40} />

I also diffed my styles with the styles you provide for the slider in the index.html, and the only style differences that I am adding that are not in yours are the following:

// Outer Container div for the Range Slider
.range-slider {
  width: 100%;
  height: 12px;
  background: #ddd;
  border: none;
  border-radius: 3px;
  background-color: $sliderColor;
}

.handle {
    font-size: 0.9em;
    text-align: center;
    color: white;
    cursor: pointer;
    border: 4px solid #ffffff;
    height: 32px;
    width: 32px;
    border-radius: 50%;
    background: $sliderThumbColor;
    margin-top: -11px;
    -webkit-box-shadow: 0 0 5px 0 #000000;
    box-shadow: 0 0 5px 0 #000000;
}

Every other style is exactly the same as your example.

When I inspect the element while dragging, I'm noticing that the inline left style attribute does not change at all, it just stays empty:

screen shot 2015-03-31 at 2 02 55 pm

Screenshot above taken while dragging the handle, notice that left is not assigned to anything.

This is a bummer because I really need 0.4.1's onAfterChange feature to perform actions when the handle stops moving as opposed to each position change.

qwtel commented 9 years ago

I can confirm that this is a bug, I'll keep you updated

eriklharper commented 9 years ago

Thanks very much! @cell303

eriklharper commented 9 years ago

lightning fast, thank you!