zillow / react-slider

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

Remove non-standard event features (Fixes "This synthetic event is reused for performance reasons" warning) #80

Closed jamesbrauman closed 8 years ago

jamesbrauman commented 8 years ago

Remove assignment to the Event.cancelBubble and Event.returnValue properties. These features are non-standard and directly setting these values on an Event causes a warning in react >= 15.0.0.

This means that we will no longer support Internet Explorer 8, but considering Microsoft ended support for Internet Explorer 8 in January this year I think that's a safe thing to do.

https://developer.mozilla.org/en-US/docs/Web/API/Event/cancelBubble https://developer.mozilla.org/en-US/docs/Web/API/Event/returnValue

jamesbrauman commented 8 years ago

If we want to remove pauseEvent and stopPropagation entirely, we could create an additional prop called disableHandleSelection which sets some additional CSS properties on the handles.

jamesbrauman commented 8 years ago

@mpowaga

djbobbydrake commented 8 years ago

Tested this and looks good to me. Warnings gone. Can we get this merged? :)

adamshone commented 8 years ago

I think you could also fix it by setting the properties on the native event rather than React's pooled synthetic event:

  function pauseEvent(e) {
    ....
    e.nativeEvent.cancelBubble = true;
    e.nativeEvent.returnValue = false;
    ...
  }

It definitely removes the warnings and might retain IE8 compatibility, but I haven't tested that :)

anhkhoi commented 8 years ago

I have the same issue. It should merged.