Skip to content

Commit

Permalink
Matt review
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Nov 9, 2019
1 parent 4b16b7c commit 6418141
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions docs/pages/api/autocomplete.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ You can learn more about the difference by [reading this guide](/guides/minimizi
| <span class="prop-name">autoSelect</span> | <span class="prop-type">bool</span> | <span class="prop-default">false</span> | If `true`, the selected option becomes the value of the input when the Autocomplete loses focus unless the user chooses a different option or changes the character string in the input. |
| <span class="prop-name">classes</span> | <span class="prop-type">object</span> | | Override or extend the styles applied to the component. See [CSS API](#css) below for more details. |
| <span class="prop-name">clearOnEscape</span> | <span class="prop-type">bool</span> | <span class="prop-default">false</span> | If `true`, clear all values when the user presses escape and the popup is closed. |
| <span class="prop-name">CloseIconComponent</span> | <span class="prop-type">elementType</span> | <span class="prop-default">IconButton</span> | The component used for the close icon. |
| <span class="prop-name">closeIcon</span> | <span class="prop-type">node</span> | <span class="prop-default">&lt;CloseIcon fontSize="small" /></span> | The icon to display in place of the default close icon. |
| <span class="prop-name">debug</span> | <span class="prop-type">bool</span> | <span class="prop-default">false</span> | If `true`, the popup will ignore the blur event if the input if filled. You can inspect the popup markup with your browser tools. Consider this option when you need to customize the component. |
| <span class="prop-name">defaultValue</span> | <span class="prop-type">any</span> | | The default input value. Use when the component is not controlled. |
| <span class="prop-name">disableClearable</span> | <span class="prop-type">bool</span> | <span class="prop-default">false</span> | If `true`, the input can't be cleared. |
Expand Down Expand Up @@ -58,7 +58,7 @@ You can learn more about the difference by [reading this guide](/guides/minimizi
| <span class="prop-name">options</span> | <span class="prop-type">array</span> | <span class="prop-default">[]</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">PopupIconComponent</span> | <span class="prop-type">elementType</span> | <span class="prop-default">IconButton</span> | The component used for the popop indicator icon. |
| <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. |
| <span class="prop-name">renderGroup</span> | <span class="prop-type">func</span> | | Render the group.<br><br>**Signature:**<br>`function(option: any) => ReactNode`<br>*option:* The group to render. |
| <span class="prop-name required">renderInput&nbsp;*</span> | <span class="prop-type">func</span> | | Render the input.<br><br>**Signature:**<br>`function(params: object) => ReactNode`<br>*params:* null |
| <span class="prop-name">renderOption</span> | <span class="prop-type">func</span> | | Render the option, use `getOptionLabel` by default.<br><br>**Signature:**<br>`function(option: any, state: object) => ReactNode`<br>*option:* The option to render.<br>*state:* The state of the component. |
Expand Down
8 changes: 4 additions & 4 deletions packages/material-ui-lab/src/Autocomplete/Autocomplete.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ export interface AutocompleteProps
'defaultValue' | 'onChange' | 'children'
> {
/**
* The component used for the close icon.
* The icon to display in place of the default close icon.
*/
CloseIconComponent?: React.ComponentType<React.HTMLAttributes<HTMLElement>>;
closeIcon?: React.ReactNode;
/**
* If `true`, the input will be disabled.
*/
Expand Down Expand Up @@ -79,9 +79,9 @@ export interface AutocompleteProps
*/
PopperComponent?: React.ComponentType<PopperProps>;
/**
* The component used for the popop indicator icon.
* The icon to display in place of the default popup icon.
*/
PopupIconComponent?: React.ComponentType<React.HTMLAttributes<HTMLElement>>;
popupIcon?: React.ReactNode;
/**
* Render the group.
*
Expand Down
24 changes: 12 additions & 12 deletions packages/material-ui-lab/src/Autocomplete/Autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ const Autocomplete = React.forwardRef(function Autocomplete(props, ref) {
classes,
className,
clearOnEscape = false,
CloseIconComponent = IconButton,
closeIcon = <CloseIcon fontSize="small" />,
debug = false,
defaultValue,
disableClearable = false,
Expand Down Expand Up @@ -193,7 +193,7 @@ const Autocomplete = React.forwardRef(function Autocomplete(props, ref) {
options = [],
PaperComponent = Paper,
PopperComponent: PopperComponentProp = Popper,
PopupIconComponent = IconButton,
popupIcon = <ArrowDropDownIcon />,
renderGroup: renderGroupProp,
renderInput,
renderOption: renderOptionProp,
Expand Down Expand Up @@ -297,28 +297,28 @@ const Autocomplete = React.forwardRef(function Autocomplete(props, ref) {
endAdornment: (
<React.Fragment>
{disableClearable || disabled ? null : (
<CloseIconComponent
<IconButton
{...getClearProps()}
title="Clear"
className={clsx(classes.clearIndicator, {
[classes.clearIndicatorDirty]: dirty,
})}
>
<CloseIcon fontSize="small" />
</CloseIconComponent>
{closeIcon}
</IconButton>
)}

{freeSolo ? null : (
<PopupIconComponent
<IconButton
{...getPopupIndicatorProps()}
disabled={disabled}
title={popupOpen ? 'Close popup' : 'Open popup'}
className={clsx(classes.popupIndicator, {
[classes.popupIndicatorOpen]: popupOpen,
})}
>
<ArrowDropDownIcon />
</PopupIconComponent>
{popupIcon}
</IconButton>
)}
</React.Fragment>
),
Expand Down Expand Up @@ -407,9 +407,9 @@ Autocomplete.propTypes = {
*/
clearOnEscape: PropTypes.bool,
/**
* The component used for the close icon.
* The icon to display in place of the default close icon.
*/
CloseIconComponent: PropTypes.elementType,
closeIcon: PropTypes.node,
/**
* If `true`, the popup will ignore the blur event if the input if filled.
* You can inspect the popup markup with your browser tools.
Expand Down Expand Up @@ -545,9 +545,9 @@ Autocomplete.propTypes = {
*/
PopperComponent: PropTypes.elementType,
/**
* The component used for the popop indicator icon.
* The icon to display in place of the default popup icon.
*/
PopupIconComponent: PropTypes.elementType,
popupIcon: PropTypes.node,
/**
* Render the group.
*
Expand Down

0 comments on commit 6418141

Please sign in to comment.