Skip to content

Input collapses for multi select & no placeholder & no initial selection #1368

@muendlein

Description

@muendlein

When using multi select without a placerholder or an initial value the input box seems to collapse. As far as I can tell this is caused by setWidth() being called which results in 1ch as the width.
It seems like this got introduced here (9fc283c) in order to handle initial selections.

Choices/src/scripts/choices.ts

Lines 2296 to 2309 in 5e25576

if (this._isSelectOneElement) {
this.input.placeholder = this.config.searchPlaceholderValue || '';
if (this.config.searchEnabled) {
dropdownElement.insertBefore(this.input.element, dropdownElement.firstChild);
}
} else {
if (!this._isSelectMultipleElement || this.config.searchEnabled) {
containerInner.element.appendChild(this.input.element);
}
if (this._placeholderValue) {
this.input.placeholder = this._placeholderValue;
}
this.input.setWidth();
}

(present in v11.1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions