Skip to content

Commit

Permalink
docs(Search): make input value editable (carbon-design-system#2121)
Browse files Browse the repository at this point in the history
* docs(Search): expose defaultValue instead of value

* chore(Search): update prop types
  • Loading branch information
emyarod authored Mar 29, 2019
1 parent 1bb28c3 commit 9124111
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/Search/Search-story.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const props = () => ({
small: boolean('Small UI (small)', false),
light: boolean('Light variant (light)', false),
name: text('Form item name (name)', ''),
value: text('Value (value)', ''),
defaultValue: text('Default value (defaultValue)', ''),
labelText: text('Label text (labelText)', 'Search'),
closeButtonLabelText: text(
'The label text for the close button (closeButtonLabelText)',
Expand Down
10 changes: 10 additions & 0 deletions src/components/Search/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ export default class Search extends Component {
* `true` to use the light version.
*/
light: PropTypes.bool,

/**
* Specify the value of the <input>
*/
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),

/**
* Optionally provide the default value of the <input>
*/
defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
};

static defaultProps = {
Expand Down

0 comments on commit 9124111

Please sign in to comment.