From 92e3310d44658d0765f099733c048b42202aedb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=87etin?= <69278826+cetincakiroglu@users.noreply.github.com> Date: Wed, 14 Feb 2024 17:15:22 +0300 Subject: [PATCH] Fixed #14788 - update select condition to prevent selection of already selected item --- src/app/components/dropdown/dropdown.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/app/components/dropdown/dropdown.ts b/src/app/components/dropdown/dropdown.ts index 923b8b7a8b8..64a525a0cae 100755 --- a/src/app/components/dropdown/dropdown.ts +++ b/src/app/components/dropdown/dropdown.ts @@ -1107,11 +1107,13 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV } onOptionSelect(event, option, isHide = true, preventChange = false) { - const value = this.getOptionValue(option); - this.updateModel(value, event); - this.focusedOptionIndex.set(this.findSelectedOptionIndex()); - isHide && setTimeout(() => this.hide(true), 1); - preventChange === false && this.onChange.emit({ originalEvent: event, value: value }); + if (!this.isSelected(option)) { + const value = this.getOptionValue(option); + this.updateModel(value, event); + this.focusedOptionIndex.set(this.findSelectedOptionIndex()); + isHide && setTimeout(() => this.hide(true), 1); + preventChange === false && this.onChange.emit({ originalEvent: event, value: value }); + } } onOptionMouseEnter(event, index) {