Skip to content

Commit

Permalink
Fixed #14023 - Dropdown | Refactor writeValue method
Browse files Browse the repository at this point in the history
  • Loading branch information
cetincakiroglu committed Nov 6, 2023
1 parent 9c487d3 commit 9e0ae93
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/app/components/dropdown/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV
}

get isVisibleClearIcon(): boolean | undefined {
return this.modelValue() != null && this.modelValue() !== '' && this.showClear && !this.disabled;
return this.modelValue() != null && ObjectUtils.isNotEmpty(this.modelValue()) && this.modelValue() !== '' && this.showClear && !this.disabled;
}

get containerClass() {
Expand Down Expand Up @@ -1052,6 +1052,7 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV
});
}
this.modelValue.set(value);
console.log(this.modelValue(), this.value)

This comment has been minimized.

Copy link
@ThoSap

ThoSap Nov 6, 2023

Contributor

@cetincakiroglu this console.log should probably be removed

This comment has been minimized.

Copy link
@ThoSap

ThoSap Nov 6, 2023

Contributor

Nevermind, already done in d09a905

this.selectedOptionUpdated = true;

}
Expand Down Expand Up @@ -1115,7 +1116,7 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV
if (this.filter) {
this.resetFilter();
}
this.value = this.modelValue();
this.value = value;
this.updateModel(this.value);
this.updateEditableLabel();
this.cd.markForCheck();
Expand Down

0 comments on commit 9e0ae93

Please sign in to comment.