Skip to content

Commit 4ce96fb

Browse files
committed
Merge pull request insin#18 from bpugh/allow-enter
Allow form submission by hitting enter
2 parents 649cf14 + ea94d4b commit 4ce96fb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/index.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ var MaskedInput = React.createClass({
119119
// console.log('onKeyPress', JSON.stringify(getSelection(this.input)), e.key, e.target.value)
120120

121121
// Ignore modified key presses
122-
if (e.metaKey || e.altKey || e.ctrlKey) { return }
122+
// Ignore enter key to allow form submission
123+
if (e.metaKey || e.altKey || e.ctrlKey || e.key == 'Enter') { return }
123124

124125
e.preventDefault()
125126
this._updateMaskSelection()

0 commit comments

Comments
 (0)