Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/materialize-directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,14 @@ export class MaterializeDirective implements AfterViewInit,DoCheck,OnChanges,OnD

public ngOnChanges(_unused?) {
if (this.isSelect()) {
setTimeout(() => this.performLocalElementUpdates(), 10);
const nativeElement = this._el.nativeElement;
const jQueryElement = $(nativeElement);

// run performLocalElementUpdates() only if dropdown closed
// otherwise the dropdown closes unexpected
if (!jQueryElement.attr("multiple") || jQueryElement.parent().find("input.active").length === 0) {
setTimeout(() => this.performLocalElementUpdates(), 10);
}
}
}

Expand Down