From 541577ff31a21ccb4c8c866c756e91e6e54c783d Mon Sep 17 00:00:00 2001 From: aurnik Date: Wed, 19 Feb 2020 13:45:51 +0800 Subject: [PATCH 1/2] [docs] Fix typo The description for the `selectOnFocus` prop of `Autocomplete` had the word "clearning", which (based on the functionality) I'm assuming was meant to be "clear". --- docs/pages/api/autocomplete.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pages/api/autocomplete.md b/docs/pages/api/autocomplete.md index 1ffa03c5ef1e6a..5890cc987842de 100644 --- a/docs/pages/api/autocomplete.md +++ b/docs/pages/api/autocomplete.md @@ -73,7 +73,7 @@ You can learn more about the difference by [reading this guide](/guides/minimizi | renderInput * | func | | Render the input.

**Signature:**
`function(params: object) => ReactNode`
*params:* null | | renderOption | func | | Render the option, use `getOptionLabel` by default.

**Signature:**
`function(option: T, state: object) => ReactNode`
*option:* The option to render.
*state:* The state of the component. | | renderTags | func | | Render the selected value.

**Signature:**
`function(value: undefined, getTagProps: function) => ReactNode`
*value:* The `value` provided to the component.
*getTagProps:* A tag props getter. | -| selectOnFocus | bool | !props.freeSolo | If `true`, the input's text will be selected on focus. It helps the user clearning the selected value. | +| selectOnFocus | bool | !props.freeSolo | If `true`, the input's text will be selected on focus. It helps the user clear the selected value. | | size | 'medium'
| 'small'
| 'medium' | The size of the autocomplete. | | value | any
| array
| | The value of the autocomplete.
The value must have reference equality with the option in order to be selected. You can customize the equality behavior with the `getOptionSelected` prop. | From c7dd87a7857a029bc2df70513eb29825a4d35631 Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Wed, 19 Feb 2020 12:16:43 +0100 Subject: [PATCH 2/2] fix all cases --- docs/src/pages/components/autocomplete/autocomplete.md | 2 +- packages/material-ui-lab/src/Autocomplete/Autocomplete.js | 2 +- .../material-ui-lab/src/useAutocomplete/useAutocomplete.d.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/src/pages/components/autocomplete/autocomplete.md b/docs/src/pages/components/autocomplete/autocomplete.md index 05a790f5dfabf0..6ec7d561ca090f 100644 --- a/docs/src/pages/components/autocomplete/autocomplete.md +++ b/docs/src/pages/components/autocomplete/autocomplete.md @@ -34,7 +34,7 @@ Choose one country between 248. Set `freeSolo` to true so the textbox can contain any arbitrary value. The prop is designed to cover the primary use case of a search box with suggestions, e.g. Google search. -However, if you intend to use it for a [combo box](#combo-box) like experience (an enhanced version of a select element) we recommend setting `selectOnFocus` (it helps the user clearning the selected value). +However, if you intend to use it for a [combo box](#combo-box) like experience (an enhanced version of a select element) we recommend setting `selectOnFocus` (it helps the user clear the selected value). {{"demo": "pages/components/autocomplete/FreeSolo.js"}} diff --git a/packages/material-ui-lab/src/Autocomplete/Autocomplete.js b/packages/material-ui-lab/src/Autocomplete/Autocomplete.js index ebfbd5226fffca..463ff0f2f7c529 100644 --- a/packages/material-ui-lab/src/Autocomplete/Autocomplete.js +++ b/packages/material-ui-lab/src/Autocomplete/Autocomplete.js @@ -745,7 +745,7 @@ Autocomplete.propTypes = { renderTags: PropTypes.func, /** * If `true`, the input's text will be selected on focus. - * It helps the user clearning the selected value. + * It helps the user clear the selected value. */ selectOnFocus: PropTypes.bool, /** diff --git a/packages/material-ui-lab/src/useAutocomplete/useAutocomplete.d.ts b/packages/material-ui-lab/src/useAutocomplete/useAutocomplete.d.ts index d25398ed1ba4d2..e616b2b1a94824 100644 --- a/packages/material-ui-lab/src/useAutocomplete/useAutocomplete.d.ts +++ b/packages/material-ui-lab/src/useAutocomplete/useAutocomplete.d.ts @@ -160,7 +160,7 @@ export interface UseAutocompleteCommonProps { options: T[]; /** * If `true`, the input's text will be selected on focus. - * It helps the user clearning the selected value. + * It helps the user clear the selected value. */ selectOnFocus?: boolean; }