Skip to content

Commit

Permalink
fix: onAfterChange now returns the correct value when used as a con…
Browse files Browse the repository at this point in the history
…trolled component

Fixes #201
  • Loading branch information
Brian Stone committed Nov 10, 2020
1 parent 0f921e3 commit 03fcc17
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/ReactSlider/ReactSlider.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -425,15 +425,16 @@ class ReactSlider extends React.Component {
};

onEnd(eventMap) {
// Allow controlled updates to continue
this.setState({ pending: false });

if (eventMap) {
removeHandlers(eventMap);
}
if (this.hasMoved) {
this.fireChangeEvent('onAfterChange');
}

// Allow controlled updates to continue
this.setState({ pending: false });

this.hasMoved = false;
}

Expand Down

0 comments on commit 03fcc17

Please sign in to comment.