Skip to content

Commit

Permalink
Fixed #14036 - ListBox | Refactor onClick emitter
Browse files Browse the repository at this point in the history
  • Loading branch information
cetincakiroglu committed Nov 6, 2023
1 parent 26443f2 commit fc68381
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/app/components/listbox/listbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -750,12 +750,6 @@ export class Listbox implements AfterContentInit, OnInit, ControlValueAccessor,
this.modelValue.set(value);
this.onModelChange(value);

if(event && event.type == 'click') {
this.onClick.emit({
originalEvent: event,
value: value
});
}
this.onChange.emit({ originalEvent: event, value: this.value });
}

Expand All @@ -768,6 +762,8 @@ export class Listbox implements AfterContentInit, OnInit, ControlValueAccessor,
return;
}

event && this.onClick.emit({originalEvent: event, value: option});

this.multiple ? this.onOptionSelectMultiple(event, option) : this.onOptionSelectSingle(event, option);
this.optionTouched = false;
index !== -1 && this.focusedOptionIndex.set(index);
Expand Down

1 comment on commit fc68381

@vercel
Copy link

@vercel vercel bot commented on fc68381 Nov 6, 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.