mirror of
https://github.com/wassname/slider.git
synced 2026-09-09 11:35:22 +08:00
fix: should trigger event after the value is changed
This commit is contained in:
@@ -182,6 +182,9 @@ class Slider extends React.Component {
|
||||
recent: valueNeedChanging,
|
||||
});
|
||||
|
||||
const oldValue = state[valueNeedChanging];
|
||||
if (value === oldValue) return;
|
||||
|
||||
const props = this.props;
|
||||
// If it is not controlled component
|
||||
if (!('value' in props) && !('index' in props)) {
|
||||
|
||||
Reference in New Issue
Block a user