Skip to content

Commit

Permalink
Fixed #314
Browse files Browse the repository at this point in the history
  • Loading branch information
Merve7 committed Feb 27, 2018
1 parent a7df47e commit 72fef87
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/components/spinner/Spinner.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,33 +204,36 @@ export class Spinner extends Component {
onInputKeyPress(event) {
let inputChar = String.fromCharCode(event.charCode);
let keyPattern = /[0-9+-]/;
if (!keyPattern.test(inputChar) && inputChar !== this.props.decimalSeparator) {
if (!keyPattern.test(inputChar) && inputChar !== this.props.decimalSeparator ) {
event.preventDefault();
}
}

onInputKeyUp(event) {

let inputValue = event.target.value;
if (event.key === this.props.decimalSeparator && event.key !== this.thousandSeparator)
if (event.key === this.props.decimalSeparator && event.key === this.props.thousandSeparator)
this.value = inputValue;
else
this.value = this.parseValue(inputValue);

this.formatValue();
this.inputEl.value = this.valueAsString;
setTimeout(()=>{
this.inputEl.value = this.valueAsString;
},5000);


if (this.props.onChange) {
this.props.onChange({
value: this.value
})
}

this.updateFilledState();
}

onInputBlur(event) {
let val = this.value;
if(val !== undefined && val != null) {
if(val !== undefined && val !== null) {
this.value = this.updateValue(val);
}

Expand Down

0 comments on commit 72fef87

Please sign in to comment.