Skip to content

Commit

Permalink
Fixed #14100 - MultiSelect | Refactor onChange
Browse files Browse the repository at this point in the history
  • Loading branch information
cetincakiroglu committed Nov 15, 2023
1 parent 284dc12 commit 2008537
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/app/components/multiselect/multiselect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1175,11 +1175,6 @@ export class MultiSelect implements OnInit, AfterViewInit, AfterContentInit, Aft
this.value = value;
this.onModelChange(value);
this.modelValue.set(value);

this.onChange.emit({
originalEvent: event,
value: value
});
}

onOptionSelect(event, isFocus = false, index = -1) {
Expand All @@ -1201,6 +1196,12 @@ export class MultiSelect implements OnInit, AfterViewInit, AfterContentInit, Aft
index !== -1 && this.focusedOptionIndex.set(index);

isFocus && DomHandler.focus(this.focusInputViewChild?.nativeElement);

this.onChange.emit({
originalEvent: event,
value: value,
itemValue: option
});
}

onOptionSelectRange(event, start = -1, end = -1) {
Expand Down Expand Up @@ -1776,9 +1777,8 @@ export class MultiSelect implements OnInit, AfterViewInit, AfterContentInit, Aft
writeValue(value: any): void {
this.value = value;
this.modelValue.set(this.value);
this.updateModel(this.value);
this.onModelChange(this.value)
this.checkSelectionLimit();

this.cd.markForCheck();
}

Expand Down

1 comment on commit 2008537

@vercel
Copy link

@vercel vercel bot commented on 2008537 Nov 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.