From 66d1480e8e90e7ae9e3ca9446571144e1171972e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=87etin?= <69278826+cetincakiroglu@users.noreply.github.com> Date: Sat, 4 Nov 2023 08:48:08 +0300 Subject: [PATCH] Fixed #13998 - Add missing onClick emitter --- src/app/components/listbox/listbox.interface.ts | 2 +- src/app/components/listbox/listbox.ts | 7 +++++++ src/app/showcase/doc/listbox/basicdoc.ts | 6 +++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/app/components/listbox/listbox.interface.ts b/src/app/components/listbox/listbox.interface.ts index 42cfff8145c..506c9286a74 100644 --- a/src/app/components/listbox/listbox.interface.ts +++ b/src/app/components/listbox/listbox.interface.ts @@ -62,7 +62,7 @@ export interface ListboxClickEvent { /** * Selected option */ - option: any; + option?: any; } /** * Custom change event. diff --git a/src/app/components/listbox/listbox.ts b/src/app/components/listbox/listbox.ts index b02e1b228b7..93df7191e6c 100755 --- a/src/app/components/listbox/listbox.ts +++ b/src/app/components/listbox/listbox.ts @@ -749,6 +749,13 @@ export class Listbox implements AfterContentInit, OnInit, ControlValueAccessor, this.value = value; this.modelValue.set(value); this.onModelChange(value); + + if(event && event.type == 'click') { + this.onClick.emit({ + originalEvent: event, + value: value + }); + } } removeOption(option) { diff --git a/src/app/showcase/doc/listbox/basicdoc.ts b/src/app/showcase/doc/listbox/basicdoc.ts index d5ccd1127a4..aabd87e7172 100644 --- a/src/app/showcase/doc/listbox/basicdoc.ts +++ b/src/app/showcase/doc/listbox/basicdoc.ts @@ -17,7 +17,7 @@ interface City {