Skip to content
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 @@ -42,6 +42,7 @@ You can learn more about the difference by [reading this guide](/guides/minimizi
| <span class="prop-name">disablePortal</span> | <span class="prop-type">bool</span> | <span class="prop-default">false</span> | Disable the portal behavior. The children stay within it's parent DOM hierarchy. |
| <span class="prop-name">filterOptions</span> | <span class="prop-type">func</span> | | A filter function that determines the options that are eligible.<br><br>**Signature:**<br>`function(options: undefined, state: object) => undefined`<br>*options:* The options to render.<br>*state:* The state of the component. |
| <span class="prop-name">filterSelectedOptions</span> | <span class="prop-type">bool</span> | <span class="prop-default">false</span> | If `true`, hide the selected options from the list box. |
| <span class="prop-name">forcePopupIcon</span> | <span class="prop-type">'auto'<br>&#124;&nbsp;bool</span> | <span class="prop-default">'auto'</span> | Force the visibility display of the popup icon. |
| <span class="prop-name">freeSolo</span> | <span class="prop-type">bool</span> | <span class="prop-default">false</span> | If `true`, the Autocomplete is free solo, meaning that the user input is not bound to provided options. |
| <span class="prop-name">getOptionDisabled</span> | <span class="prop-type">func</span> | | Used to determine the disabled state for a given option. |
| <span class="prop-name">getOptionLabel</span> | <span class="prop-type">func</span> | <span class="prop-default">x => x</span> | Used to determine the string value for a given option. It's used to fill the input (and the list box options if `renderOption` is not provided). |
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 @@ -67,6 +67,10 @@ export interface AutocompleteProps
* The children stay within it's parent DOM hierarchy.
*/
disablePortal?: boolean;
/**
* Force the visibility display of the popup icon.
*/
forcePopupIcon?: true | false | 'auto';
/**
* The component used to render the listbox.
*/
Expand Down
9 changes: 7 additions & 2 deletions packages/material-ui-lab/src/Autocomplete/Autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ const Autocomplete = React.forwardRef(function Autocomplete(props, ref) {
disablePortal = false,
filterOptions,
filterSelectedOptions = false,
forcePopupIcon = 'auto',
freeSolo = false,
getOptionDisabled,
getOptionLabel = x => x,
Expand Down Expand Up @@ -340,7 +341,7 @@ const Autocomplete = React.forwardRef(function Autocomplete(props, ref) {
</IconButton>
)}

{freeSolo ? null : (
{(!freeSolo || forcePopupIcon === true) && forcePopupIcon !== false ? (
<IconButton
{...getPopupIndicatorProps()}
disabled={disabled}
Expand All @@ -352,7 +353,7 @@ const Autocomplete = React.forwardRef(function Autocomplete(props, ref) {
>
{popupIcon}
</IconButton>
)}
) : null}
</div>
),
},
Expand Down Expand Up @@ -504,6 +505,10 @@ Autocomplete.propTypes = {
* If `true`, hide the selected options from the list box.
*/
filterSelectedOptions: PropTypes.bool,
/**
* Force the visibility display of the popup icon.
*/
forcePopupIcon: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.bool]),
/**
* If `true`, the Autocomplete is free solo, meaning that the user input is not bound to provided options.
*/
Expand Down