TanStack / ranger

🤖 Headless utilities for building range and multi-range sliders in React, Preact, Solid, Vue, Svelte and Angular
MIT License
757 stars 65 forks source link

call onChange only when function has been provided #6

Closed Simek closed 4 years ago

Simek commented 6 years ago

"onChange" prop is marked as NON-required function, but component always call that function without checking if it exist which causes an error, when no "onChange" function has been provided and user interacts with slider handle.

Simek commented 4 years ago

@tannerlinsley ?

tannerlinsley commented 4 years ago

This was a refactor and I was unable to merge the change in its form here. The issue is fixed in the new version though.