Skip to content

Commit f64c56d

Browse files
committed
Add required prop to Input
1 parent 7a878dc commit f64c56d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/components/input/Input.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,20 @@ Input.propTypes = {
343343
*/
344344
invalid: PropTypes.bool,
345345

346+
/**
347+
* This attribute specifies that the user must fill in a value before
348+
* submitting a form. It cannot be used when the type attribute is hidden,
349+
* image, or a button type (submit, reset, or button). The :optional and
350+
* :required CSS pseudo-classes will be applied to the field as appropriate.
351+
* required is an HTML boolean attribute - it is enabled by a boolean or
352+
* 'required'. Alternative capitalizations `REQUIRED`
353+
* are also acccepted.
354+
*/
355+
required: PropTypes.oneOfType([
356+
PropTypes.oneOf(['required', 'REQUIRED']),
357+
PropTypes.bool
358+
]),
359+
346360
/**
347361
* Set to true for a readonly input styled as plain text with the default
348362
* form field styling removed and the correct margins and padding preserved.

0 commit comments

Comments
 (0)