Skip to content

Commit

Permalink
[TextField] Accept boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
palaniichukdmytro committed Aug 15, 2018
1 parent bce6ebd commit fc0da9d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pages/api/text-field.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ For advanced cases, please look at the source of TextField by clicking on the
| select | bool | false | Render a `Select` element while passing the `Input` element to `Select` as `input` parameter. If this option is set you must pass the options of the select as children. |
| SelectProps | object | | Properties applied to the `Select` element. |
| type | string | | Type attribute of the `Input` element. It should be a valid HTML5 input type. |
| value | union:&nbsp;string&nbsp;&#124;<br>&nbsp;number&nbsp;&#124;<br>&nbsp;arrayOf<br> | | The value of the `Input` element, required for a controlled component. |
| value | union:&nbsp;string&nbsp;&#124;<br>&nbsp;number&nbsp;&#124;<br>&nbsp;bool&nbsp;&#124;<br>&nbsp;arrayOf<br> | | The value of the `Input` element, required for a controlled component. |

Any other properties supplied will be [spread to the root element](/guides/api#spread).

Expand Down
2 changes: 1 addition & 1 deletion src/TextField/TextField.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export interface TextFieldProps
select?: boolean;
SelectProps?: Partial<SelectProps>;
type?: string;
value?: Array<string | number> | string | number;
value?: Array<string | number | boolean> | string | number | boolean;
}

export type TextFieldClassKey = FormControlClassKey;
Expand Down
3 changes: 2 additions & 1 deletion src/TextField/TextField.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,8 @@ TextField.propTypes = {
value: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number,
PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),
PropTypes.bool,
PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.bool])),
]),
};

Expand Down

0 comments on commit fc0da9d

Please sign in to comment.