Skip to content

Commit

Permalink
fix(Search): onChange was returning a wrong target value (#368)
Browse files Browse the repository at this point in the history
  • Loading branch information
Utzel-Butzel committed Jan 4, 2021
1 parent cbabcd3 commit d422086
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/components/Search/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function Search(props) {
evt.persist();
evt.imaginaryTarget = _inputRef;
setValue(evt.target.value);
onChange(parseFloat(evt.target.value), evt);
onChange(evt.target.value, evt);
}
};

Expand All @@ -55,7 +55,6 @@ function Search(props) {
onChange(valueState);
};


const numberInputClasses = classNames(`${prefix}--number`, className, {
[`${prefix}--number--light`]: light,
[`${prefix}--number--helpertext`]: helperText,
Expand All @@ -76,7 +75,6 @@ function Search(props) {
value: value,
};


const clearClasses = classNames({
'wfp--search-close': true,
'wfp--search-close--hidden': !value,
Expand Down Expand Up @@ -139,13 +137,13 @@ Search.propTypes = {
*/
id: PropTypes.string.isRequired,

/**
/**
* Generic `label` that will be used as the textual representation of what
* this field is for
*/
labelText: PropTypes.node,

/**
/**
* The new value is available in 'imaginaryTarget.value'
* i.e. to get the value: evt.imaginaryTarget.value
*/
Expand Down

0 comments on commit d422086

Please sign in to comment.