Browse Source

Add missing typescript inputValue to Select to enable placeholder to display for type string

Reason: RC-Select has this parameter to accept string value and it will
        be a quick-fix to enable Typescript to acept inputValue.

Note:
- Added parameter in Documentation
pull/18626/head
Daphne Won 5 years ago
committed by 偏右
parent
commit
9dc0378b3f
  1. 1
      components/select/index.en-US.md
  2. 1
      components/select/index.tsx

1
components/select/index.en-US.md

@ -54,6 +54,7 @@ Select component to select value from options.
| menuItemSelectedIcon | The custom menuItemSelected icon with multiple options | ReactNode | - | 3.11.0 |
| tokenSeparators | Separator used to tokenize on tag/multiple mode | string\[] | | |
| value | Current selected option. | string\|string\[]\<br />number\|number\[]\<br />LabeledValue\|LabeledValue[] | - | |
| inputValue | Current search text | string | - | |
| onBlur | Called when blur | function | - | |
| onChange | Called when select an option or input value change, or value of input is changed in combobox mode | function(value, option:Option/Array&lt;Option>) | - | |
| onDeselect | Called when a option is deselected, param is the selected option's value. Only called for multiple or tags, effective in multiple or tags mode only. | function(string\|number\|LabeledValue) | - | |

1
components/select/index.tsx

@ -53,6 +53,7 @@ export type SelectValue = string | string[] | number | number[] | LabeledValue |
export interface SelectProps<T = SelectValue> extends AbstractSelectProps {
value?: T;
inputValue?: string;
defaultValue?: T;
mode?: 'default' | 'multiple' | 'tags' | 'combobox' | string;
optionLabelProp?: string;

Loading…
Cancel
Save