Skip to content

Commit

Permalink
[Autocomplete] Make options required (#19648)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandesigner authored Feb 11, 2020
1 parent e534b94 commit 337822c
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docs/pages/api/autocomplete.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ You can learn more about the difference by [reading this guide](/guides/minimizi
| <span class="prop-name">onOpen</span> | <span class="prop-type">func</span> | | Callback fired when the popup requests to be opened. Use in controlled mode (see open).<br><br>**Signature:**<br>`function(event: object) => void`<br>*event:* The event source of the callback. |
| <span class="prop-name">open</span> | <span class="prop-type">bool</span> | | Control the popup` open state. |
| <span class="prop-name">openText</span> | <span class="prop-type">string</span> | <span class="prop-default">'Open'</span> | Override the default text for the *open popup* icon button.<br>For localization purposes, you can use the provided [translations](/guides/localization/). |
| <span class="prop-name">options</span> | <span class="prop-type">array</span> | <span class="prop-default">[]</span> | Array of options. |
| <span class="prop-name required">options&nbsp;*</span> | <span class="prop-type">array</span> | | Array of options. |
| <span class="prop-name">PaperComponent</span> | <span class="prop-type">elementType</span> | <span class="prop-default">Paper</span> | The component used to render the body of the popup. |
| <span class="prop-name">PopperComponent</span> | <span class="prop-type">elementType</span> | <span class="prop-default">Popper</span> | The component used to position the popup. |
| <span class="prop-name">popupIcon</span> | <span class="prop-type">node</span> | <span class="prop-default">&lt;ArrowDropDownIcon /></span> | The icon to display in place of the default popup icon. |
Expand Down
4 changes: 2 additions & 2 deletions packages/material-ui-lab/src/Autocomplete/Autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ const Autocomplete = React.forwardRef(function Autocomplete(props, ref) {
onOpen,
open,
openText = 'Open',
options = [],
options,
PaperComponent = Paper,
PopperComponent: PopperComponentProp = Popper,
popupIcon = <ArrowDropDownIcon />,
Expand Down Expand Up @@ -700,7 +700,7 @@ Autocomplete.propTypes = {
/**
* Array of options.
*/
options: PropTypes.array,
options: PropTypes.array.isRequired,
/**
* The component used to render the body of the popup.
*/
Expand Down
Loading

0 comments on commit 337822c

Please sign in to comment.