From e5fa7f3a4ee062f20be9133165ece529ff74901c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Merve=20=C3=96z=C3=A7if=C3=A7i?= Date: Wed, 28 Feb 2018 11:06:44 +0300 Subject: [PATCH] Fixed #321 --- src/components/inputmask/InputMask.js | 4 +++- src/showcase/inputmask/InputMaskDemo.js | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/inputmask/InputMask.js b/src/components/inputmask/InputMask.js index 0770a44bf2..e2641f9278 100644 --- a/src/components/inputmask/InputMask.js +++ b/src/components/inputmask/InputMask.js @@ -23,6 +23,7 @@ export class InputMask extends Component { disabled: false, readonly: false, name: null, + required: false, onComplete: null, onChange: null } @@ -44,6 +45,7 @@ export class InputMask extends Component { disabled: PropTypes.bool, readonly: PropTypes.bool, name: PropTypes.string, + required: PropTypes.bool, onComplete: PropTypes.func, onChange: PropTypes.func } @@ -509,7 +511,7 @@ export class InputMask extends Component { this.input = ReactDOM.findDOMNode(el)} type={this.props.type} name={this.props.name} style={this.props.style} className={this.props.className} placeholder={this.props.placeholder} size={this.props.size} maxLength={this.props.maxlength} tabIndex={this.props.tabindex} disabled={this.props.disabled} readOnly={this.props.readonly} onFocus={this.onFocus.bind(this)} onBlur={this.onBlur.bind(this)} onKeyDown={this.onKeyDown.bind(this)} onKeyPress={this.onKeyPress.bind(this)} - onInput={this.onInput.bind(this)} onPaste={this.handleInputChange.bind(this)} /> + onInput={this.onInput.bind(this)} onPaste={this.handleInputChange.bind(this)} required={this.props.required}/> ); } diff --git a/src/showcase/inputmask/InputMaskDemo.js b/src/showcase/inputmask/InputMaskDemo.js index 729f79d23e..9bfe2acf1f 100644 --- a/src/showcase/inputmask/InputMaskDemo.js +++ b/src/showcase/inputmask/InputMaskDemo.js @@ -275,6 +275,12 @@ constructor() { false When present, it specifies that an input field is read-only. + + required + boolean + false + When present, it specifies that the element must be filled out before submitting the form. + name string