1
0
mirror of synced 2024-11-25 14:26:03 +03:00

only show placeholder if there are no items selected. closes #5606

This commit is contained in:
Igor Vaynberg 2019-08-13 08:41:53 -07:00
parent cb9c47af67
commit 92ca33cd74
3 changed files with 6 additions and 4 deletions

View File

@ -76,6 +76,8 @@ export class MultiSelect extends AbstractSelect<Props, State> {
} = state; } = state;
const dictionary = this.dictionary; const dictionary = this.dictionary;
const showPlaceholder = !values || values.length === 0;
let classes = cn(style.control, style.multi, { [style.open]: open }, { [style.focused]: focused }); let classes = cn(style.control, style.multi, { [style.open]: open }, { [style.focused]: focused });
if (props.containerClass && props.containerClass.length > 0) { if (props.containerClass && props.containerClass.length > 0) {
classes += ' ' + props.containerClass; classes += ' ' + props.containerClass;
@ -187,7 +189,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} placeholder={showPlaceholder ? placeholder : undefined}
/> />
<div <div
className={cn(style.toggle)} className={cn(style.toggle)}

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