add placeholder support for multiselect, closes #5569
This commit is contained in:
parent
af901bafaa
commit
54a388de15
@ -19,6 +19,7 @@ enum StoreKeys {
|
|||||||
interface BaseSelectOptions {
|
interface BaseSelectOptions {
|
||||||
containerStyle?: string;
|
containerStyle?: string;
|
||||||
containerClass?: string;
|
containerClass?: string;
|
||||||
|
placeholder?: string;
|
||||||
tabIndex?: number;
|
tabIndex?: number;
|
||||||
valueContent?: DataItemRenderer;
|
valueContent?: DataItemRenderer;
|
||||||
resultContent?: DataItemRenderer;
|
resultContent?: DataItemRenderer;
|
||||||
@ -44,7 +45,6 @@ interface SingleSelectOptions extends BaseSelectOptions {
|
|||||||
label?: string;
|
label?: string;
|
||||||
value: DataItem;
|
value: DataItem;
|
||||||
allowClear?: boolean;
|
allowClear?: boolean;
|
||||||
placeholder?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const BASE_DEFAULT_OPTIONS = {
|
const BASE_DEFAULT_OPTIONS = {
|
||||||
@ -107,6 +107,7 @@ class MultiSelectWrapper extends Component<
|
|||||||
<MultiSelect
|
<MultiSelect
|
||||||
containerClass={opts.containerClass}
|
containerClass={opts.containerClass}
|
||||||
containerStyle={opts.containerStyle}
|
containerStyle={opts.containerStyle}
|
||||||
|
placeholder={opts.placeholder}
|
||||||
valuesLabel={opts.valuesLabel}
|
valuesLabel={opts.valuesLabel}
|
||||||
comboboxLabel={opts.comboboxLabel}
|
comboboxLabel={opts.comboboxLabel}
|
||||||
valueContent={opts.valueContent}
|
valueContent={opts.valueContent}
|
||||||
|
@ -65,7 +65,7 @@ export class MultiSelect extends AbstractSelect<Props, State> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public render(props, state) {
|
public render(props, state) {
|
||||||
const { values, tabIndex, minimumCharacters, valuesLabel, comboboxLabel } = props;
|
const { values, tabIndex, minimumCharacters, valuesLabel, comboboxLabel, placeholder } = props;
|
||||||
const {
|
const {
|
||||||
open,
|
open,
|
||||||
loading,
|
loading,
|
||||||
@ -186,6 +186,7 @@ export class MultiSelect extends AbstractSelect<Props, State> {
|
|||||||
onInput={this.onSearchInput}
|
onInput={this.onSearchInput}
|
||||||
onKeyDown={this.onSearchKeyDown}
|
onKeyDown={this.onSearchKeyDown}
|
||||||
onFocus={this.onSearchFocus}
|
onFocus={this.onSearchFocus}
|
||||||
|
placeholder={placeholder}
|
||||||
/>
|
/>
|
||||||
<div className={cn(style.toggle)} aria-hidden={true} tabIndex={-1} onClick={this.onToggleClick}>
|
<div className={cn(style.toggle)} aria-hidden={true} tabIndex={-1} onClick={this.onToggleClick}>
|
||||||
<Toggle height={20} width={20} />
|
<Toggle height={20} width={20} />
|
||||||
|
@ -115,6 +115,7 @@
|
|||||||
document.getElementById('countries1'), {
|
document.getElementById('countries1'), {
|
||||||
valuesLabel: "Selected Countries",
|
valuesLabel: "Selected Countries",
|
||||||
comboboxLabel: "Add Country",
|
comboboxLabel: "Add Country",
|
||||||
|
placeholder: "Add Country",
|
||||||
minimumCharacters: 2,
|
minimumCharacters: 2,
|
||||||
query: query,
|
query: query,
|
||||||
quiet: 100,
|
quiet: 100,
|
||||||
|
4
dist/select25.js
vendored
4
dist/select25.js
vendored
File diff suppressed because one or more lines are too long
2
dist/select25.js.map
vendored
2
dist/select25.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user