Skip to content

Commit

Permalink
fix(select): Fixed selected option sometimes not appearing
Browse files Browse the repository at this point in the history
  • Loading branch information
edcarroll committed Jul 19, 2017
1 parent df06762 commit cf0973e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/modules/select/classes/select-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export abstract class SuiSelectBase<T, U> implements AfterContentInit {
} else if (this.searchService.optionsLookup) {
return o => this.labelGetter(o);
} else {
return o => this.searchService.highlightMatches(this.labelGetter(o), this.query != undefined ? this.query : "");
return o => this.searchService.highlightMatches(this.labelGetter(o), this.query || "");
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/modules/select/components/select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import { ISelectRenderedOption } from "./select-option";
[hidden]="!isSearchable || isSearchExternal">
<!-- Placeholder text -->
<div *ngIf="selectedOption == undefined" class="default text" [class.filtered]="query != undefined">{{ placeholder }}</div>
<div *ngIf="selectedOption == undefined" class="default text" [class.filtered]="query">{{ placeholder }}</div>
<!-- Selected item -->
<div class="text" [class.filtered]="query != undefined || selectedOption == undefined">
<div class="text" [class.filtered]="query || selectedOption == undefined">
<span #optionTemplateSibling></span>
<span *ngIf="!optionTemplate && selectedOption != undefined" [innerHTML]="configuredFormatter(selectedOption)"></span>
</div>
Expand Down Expand Up @@ -132,7 +132,7 @@ export class SuiSelect<T, U> extends SuiSelectBase<T, U> implements ICustomValue
this.onAvailableOptionsRendered();
}

if (this.selectedOption && this.optionTemplate) {
if (this.selectedOption != undefined && this.optionTemplate) {
this.drawTemplate(this._optionTemplateSibling, this.selectedOption);
}
}
Expand Down

0 comments on commit cf0973e

Please sign in to comment.