1
0
mirror of synced 2024-11-22 04:56:08 +03:00

add placeholder support for multiselect, closes #5569

This commit is contained in:
Igor Vaynberg 2019-07-17 07:53:40 -07:00
parent af901bafaa
commit 54a388de15
5 changed files with 8 additions and 5 deletions

View File

@ -19,6 +19,7 @@ enum StoreKeys {
interface BaseSelectOptions {
containerStyle?: string;
containerClass?: string;
placeholder?: string;
tabIndex?: number;
valueContent?: DataItemRenderer;
resultContent?: DataItemRenderer;
@ -44,7 +45,6 @@ interface SingleSelectOptions extends BaseSelectOptions {
label?: string;
value: DataItem;
allowClear?: boolean;
placeholder?: string;
}
const BASE_DEFAULT_OPTIONS = {
@ -107,6 +107,7 @@ class MultiSelectWrapper extends Component<
<MultiSelect
containerClass={opts.containerClass}
containerStyle={opts.containerStyle}
placeholder={opts.placeholder}
valuesLabel={opts.valuesLabel}
comboboxLabel={opts.comboboxLabel}
valueContent={opts.valueContent}

View File

@ -65,7 +65,7 @@ export class MultiSelect extends AbstractSelect<Props, State> {
}
public render(props, state) {
const { values, tabIndex, minimumCharacters, valuesLabel, comboboxLabel } = props;
const { values, tabIndex, minimumCharacters, valuesLabel, comboboxLabel, placeholder } = props;
const {
open,
loading,
@ -186,6 +186,7 @@ export class MultiSelect extends AbstractSelect<Props, State> {
onInput={this.onSearchInput}
onKeyDown={this.onSearchKeyDown}
onFocus={this.onSearchFocus}
placeholder={placeholder}
/>
<div className={cn(style.toggle)} aria-hidden={true} tabIndex={-1} onClick={this.onToggleClick}>
<Toggle height={20} width={20} />

View File

@ -115,6 +115,7 @@
document.getElementById('countries1'), {
valuesLabel: "Selected Countries",
comboboxLabel: "Add Country",
placeholder: "Add Country",
minimumCharacters: 2,
query: query,
quiet: 100,

4
dist/select25.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long