You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by vi...@apache.org on 2021/09/22 10:35:30 UTC

[superset] 13/17: perf(dashboard): fix filter-box performance bug (#16702)

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

villebro pushed a commit to branch 1.3
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 555ba7d04b1517eeb9f3f8b53329a2ee75f5982a
Author: Stephen Liu <75...@qq.com>
AuthorDate: Wed Sep 15 13:40:46 2021 +0800

    perf(dashboard): fix filter-box performance bug (#16702)
    
    (cherry picked from commit b0ac5d1625a0e14ac86d564c9c534bc2183063a5)
---
 superset-frontend/src/components/Select/DeprecatedSelect.tsx | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/superset-frontend/src/components/Select/DeprecatedSelect.tsx b/superset-frontend/src/components/Select/DeprecatedSelect.tsx
index 20afd0e..5d8f405 100644
--- a/superset-frontend/src/components/Select/DeprecatedSelect.tsx
+++ b/superset-frontend/src/components/Select/DeprecatedSelect.tsx
@@ -249,8 +249,15 @@ function styled<
     if (forceOverflow) {
       Object.assign(restProps, {
         closeMenuOnScroll: (e: Event) => {
+          // ensure menu is open
+          const menuIsOpen = (stateManager as BasicSelect<OptionType>)?.state
+            ?.menuIsOpen;
           const target = e.target as HTMLElement;
-          return target && !target.classList?.contains('Select__menu-list');
+          return (
+            menuIsOpen &&
+            target &&
+            !target.classList?.contains('Select__menu-list')
+          );
         },
         menuPosition: 'fixed',
       });