Skip to content

Commit

Permalink
Merge pull request #9 from navedqb/14513--fix-clear-button-functional…
Browse files Browse the repository at this point in the history
…ity-dropdown

fix: clearing selected value in editable mode
  • Loading branch information
navedqb authored Jan 9, 2024
2 parents ec65185 + e28911f commit 0a84a63
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/app/components/dropdown/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1107,6 +1107,12 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV
}
}

clearEditableLabel(): void {
if (this.editableInputViewChild) {
this.editableInputViewChild.nativeElement.value = ''
}
}

getOptionIndex(index, scrollerOptions) {
return this.virtualScrollerDisabled ? index : scrollerOptions && scrollerOptions.getItemOptions(index)['index'];
}
Expand Down Expand Up @@ -1734,7 +1740,7 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV

clear(event: Event) {
this.updateModel(null, event);
this.updateEditableLabel();
this.clearEditableLabel();
this.onChange.emit({ originalEvent: event, value: this.value });
this.onClear.emit(event);
}
Expand Down

0 comments on commit 0a84a63

Please sign in to comment.