Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding onBadInput callback #38

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"presets": ["es2015"]
"presets": ["es2015"],
"plugins": ["react-hot-loader/babel"]
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
node_modules
npm-debug.log
.DS_Store
.vscode
27 changes: 18 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ It needs react to work correctly. It is compiled without react at its source.
* required: false
* default: 0

Init value of input. If init value is '' then input is empty.
Initial value of the input. If initial value is '', then input is empty.

**When you set this prop, then component became a [Controlled Component](https://facebook.github.io/react/docs/forms.html#controlled-components)**

Expand All @@ -102,23 +102,23 @@ Init value of input. If init value is '' then input is empty.
* '.' - dot is decimal separator
* ',' - comma is decimal separator

Define number decimal separator
Defines number decimal separator

### integer

* type: Number
* required: false
* default: 10

Set maximum numbers of digits integer part (digits before decimal separator)
Sets maximum number of digits in integer part (digits before decimal separator)

### fraction

* type: Number
* required: false
* default: 10

Set maximum numbers of digits fraction part (digits after decimal separator)
Sets maximum number of digits in fraction part (digits after the decimal separator)

### positive

Expand All @@ -129,7 +129,7 @@ Set maximum numbers of digits fraction part (digits after decimal separator)
* true - number can be positive
* false - number may not be positive

Define if number may be positive
Defines whether the number may be positive

### negative

Expand All @@ -140,7 +140,7 @@ Define if number may be positive
* true - number can be negative
* false - number may not be negative

Define if number may be negative
Defines whether the number may be negative

### thousand

Expand All @@ -154,15 +154,15 @@ Define if number may be negative
* If decimal separator is dot then thousand separator is comma.
* If decimal separator is comma then thousand separator is dot.

Define number decimal separator
Defines number decimal separator

### placeholder

* type: string
* required: false
* default: none

Allow to set placeholder to empty input
Allows to set a placeholder shown in a empty input

### onChange

Expand All @@ -173,7 +173,16 @@ Allow to set placeholder to empty input
* modelValue - correct javascript number
* viewValue - string value visible in input

Define callback which will be trigger on any number change
Defines a callback which will be triggered on any number change

### onBadInput

* type: Function (callback)
* required: false

Defines a callback which will be called on entering an invalid character

****

## FAQ

Expand Down
Loading