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 2022/11/18 10:17:48 UTC

[myfaces-tobago] 01/04: feat(selectMany): fix focus for inline=true

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

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

commit 6673ebacc209e19e795ca3b514315d8c0198bb77
Author: Henning Noeth <hn...@apache.org>
AuthorDate: Thu Nov 17 11:32:20 2022 +0100

    feat(selectMany): fix focus for inline=true
    
    Issue: TOBAGO-2159
---
 .../tobago-theme-standard/src/main/ts/tobago-select-many.ts    | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tobago-theme/tobago-theme-standard/src/main/ts/tobago-select-many.ts b/tobago-theme/tobago-theme-standard/src/main/ts/tobago-select-many.ts
index 0bae17227b..6a8d9f7107 100644
--- a/tobago-theme/tobago-theme-standard/src/main/ts/tobago-select-many.ts
+++ b/tobago-theme/tobago-theme-standard/src/main/ts/tobago-select-many.ts
@@ -213,7 +213,7 @@ class SelectMany extends HTMLElement {
     if (this.isDeleted(event.target as Element)) {
       // do nothing, this is probably a removed badge
     } else if (this.isPartOfSelectField(event.target as Element)
-      || this.isPartOfDropdownMenu(event.target as Element)) {
+      || this.isPartOfTobagoOptions(event.target as Element)) {
 
       if (!this.filterInput.disabled) {
         this.filterInput.focus();
@@ -324,13 +324,13 @@ class SelectMany extends HTMLElement {
     }
   }
 
-  private isPartOfDropdownMenu(element: Element): boolean {
+  private isPartOfTobagoOptions(element: Element): boolean {
     if (element) {
-      if (element.classList.contains(this.CssClass.DROPDOWN_MENU)
+      if (element.classList.contains(this.CssClass.TOBAGO_OPTIONS)
         && this.id === element.getAttribute("name")) {
         return true;
       } else {
-        return element.parentElement ? this.isPartOfDropdownMenu(element.parentElement) : false;
+        return element.parentElement ? this.isPartOfTobagoOptions(element.parentElement) : false;
       }
     } else {
       return false;
@@ -382,7 +382,7 @@ class SelectMany extends HTMLElement {
     if (event.relatedTarget !== null) {
       //relatedTarget is the new focused element; null indicate a mouseclick or an inactive browser window
       if (!this.isPartOfSelectField(event.relatedTarget as Element)
-        && !this.isPartOfDropdownMenu(event.relatedTarget as Element)) {
+        && !this.isPartOfTobagoOptions(event.relatedTarget as Element)) {
         this.setFocus(false);
         this.hideDropdown();
       }