Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Autocomplete] Add ListboxProps prop #18887

Merged
merged 5 commits into from
Dec 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/pages/api/autocomplete.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ You can learn more about the difference by [reading this guide](/guides/minimizi
| <span class="prop-name">includeInputInList</span> | <span class="prop-type">bool</span> | <span class="prop-default">false</span> | If `true`, the highlight can move to the input. |
| <span class="prop-name">inputValue</span> | <span class="prop-type">string</span> | | The input value. |
| <span class="prop-name">ListboxComponent</span> | <span class="prop-type">elementType</span> | <span class="prop-default">'ul'</span> | The component used to render the listbox. |
| <span class="prop-name">ListboxProps</span> | <span class="prop-type">object</span> | | Props applied to the Listbox element. |
| <span class="prop-name">loading</span> | <span class="prop-type">bool</span> | <span class="prop-default">false</span> | If `true`, the component is in a loading state. |
| <span class="prop-name">loadingText</span> | <span class="prop-type">node</span> | <span class="prop-default">'Loading…'</span> | Text to display when in a loading state.<br>For localization purposes, you can use the provided [translations](/guides/localization/). |
| <span class="prop-name">multiple</span> | <span class="prop-type">bool</span> | <span class="prop-default">false</span> | If `true`, `value` must be an array and the menu will support multiple selections. |
Expand Down
4 changes: 4 additions & 0 deletions packages/material-ui-lab/src/Autocomplete/Autocomplete.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ export interface AutocompleteProps
* The component used to render the listbox.
*/
ListboxComponent?: React.ComponentType<React.HTMLAttributes<HTMLElement>>;
/**
* Props applied to the Listbox element.
*/
ListboxProps?: object;
/**
* If `true`, the component is in a loading state.
*/
Expand Down
5 changes: 5 additions & 0 deletions packages/material-ui-lab/src/Autocomplete/Autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ const Autocomplete = React.forwardRef(function Autocomplete(props, ref) {
includeInputInList = false,
inputValue: inputValueProp,
ListboxComponent = 'ul',
ListboxProps,
loading = false,
loadingText = 'Loading…',
multiple = false,
Expand Down Expand Up @@ -588,6 +589,10 @@ Autocomplete.propTypes = {
* The component used to render the listbox.
*/
ListboxComponent: PropTypes.elementType,
/**
* Props applied to the Listbox element.
*/
ListboxProps: PropTypes.object,
/**
* If `true`, the component is in a loading state.
*/
Expand Down