You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by hn...@apache.org on 2023/07/05 12:20:09 UTC

[myfaces-tobago] 01/02: fix(SelectOneList): close dropdown after entry is clicked

This is an automated email from the ASF dual-hosted git repository.

hnoeth pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git

commit 5d2a0fde5f800f1c17b71643d83ccca4ae9253c2
Author: Henning Noeth <hn...@apache.org>
AuthorDate: Wed Jul 5 13:18:20 2023 +0200

    fix(SelectOneList): close dropdown after entry is clicked
    
    * dropdown menu is closed now after an entry is clicked
    
    Issue: TOBAGO-2236
---
 .../tobago-theme-standard/src/main/ts/tobago-select-one-list.ts    | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tobago-theme/tobago-theme-standard/src/main/ts/tobago-select-one-list.ts b/tobago-theme/tobago-theme-standard/src/main/ts/tobago-select-one-list.ts
index ed72a2d149..3226a25b97 100644
--- a/tobago-theme/tobago-theme-standard/src/main/ts/tobago-select-one-list.ts
+++ b/tobago-theme/tobago-theme-standard/src/main/ts/tobago-select-one-list.ts
@@ -49,11 +49,16 @@ class SelectOneList extends SelectListBase {
 
   protected globalClickEvent(event: MouseEvent): void {
     if (!this.disabled) {
-      if (this.isPartOfSelectField(event.target as Element) || this.isPartOfTobagoOptions(event.target as Element)) {
+      if (this.isPartOfSelectField(event.target as Element)) {
         if (!this.filterInput.disabled) {
           this.filterInput.focus();
         }
         this.showDropdown();
+      } else if (this.isPartOfTobagoOptions(event.target as Element)) {
+        if (!this.filterInput.disabled) {
+          this.filterInput.focus();
+        }
+        this.hideDropdown();
       } else {
         this.leaveComponent();
       }