Skip to content

Commit 3bbb4ee

Browse files
committed
Release 0.16.15
1 parent 54fbfde commit 3bbb4ee

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-form-controlled",
3-
"version": "0.16.14",
3+
"version": "0.16.15",
44
"description": "React controlled form components. The main idea is to make forms as simple as possible.",
55
"author": {
66
"name": "Zlatko Fedor",

src/Input.jsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ export default class Input extends Element {
2525
return fixUncontrolledValue(super.getValue());
2626
}
2727

28+
@autobind
29+
onKeyPress(evn) {
30+
if (evn.key === 'Enter') {
31+
this.clearTimeout(true);
32+
}
33+
}
34+
2835
@autobind
2936
onChange(evn) {
3037
const { target } = evn;
@@ -128,6 +135,7 @@ export default class Input extends Element {
128135
onChange={this.onChange}
129136
onFocus={this.onFocus}
130137
onBlur={this.onBlur}
138+
onKeyPress={this.onKeyPress}
131139
checked={checked || void 0}
132140
value={value}
133141
/>

src/Textarea.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export default class Textarea extends Input {
2424
onChange={this.onChange}
2525
onFocus={this.onFocus}
2626
onBlur={this.onBlur}
27+
onKeyPress={this.onKeyPress}
2728
value={this.state.value}
2829
/>
2930
);

0 commit comments

Comments
 (0)