From e36de07116dbd40a9028abd559551e7106302c6a Mon Sep 17 00:00:00 2001
From: Ryan Laurie <30528226+iethree@users.noreply.github.com>
Date: Thu, 16 Jun 2022 08:29:36 -0600
Subject: [PATCH] Allow Chevron click on select button (#23343)

* allow chevron click
---
 .../metabase/core/components/SelectButton/SelectButton.tsx   | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/frontend/src/metabase/core/components/SelectButton/SelectButton.tsx b/frontend/src/metabase/core/components/SelectButton/SelectButton.tsx
index 1c246ab0613..3fd78bc8d66 100644
--- a/frontend/src/metabase/core/components/SelectButton/SelectButton.tsx
+++ b/frontend/src/metabase/core/components/SelectButton/SelectButton.tsx
@@ -21,6 +21,7 @@ export interface SelectButtonProps
   disabled?: boolean;
   fullWidth?: boolean;
   highlighted?: boolean;
+  onClick?: () => void;
   onClear?: () => void;
   dataTestId?: string;
 }
@@ -35,6 +36,7 @@ const SelectButton = forwardRef(function SelectButton(
     disabled = false,
     fullWidth = true,
     highlighted = false,
+    onClick,
     onClear,
     dataTestId,
     ...rest
@@ -70,6 +72,7 @@ const SelectButton = forwardRef(function SelectButton(
       disabled={disabled}
       highlighted={highlighted}
       fullWidth={fullWidth}
+      onClick={onClick}
       {...rest}
     >
       {React.isValidElement(left) && left}
@@ -81,7 +84,7 @@ const SelectButton = forwardRef(function SelectButton(
         size={12}
         hasValue={hasValue}
         highlighted={highlighted}
-        onClick={onClear ? handleClear : undefined}
+        onClick={rightIcon === "close" ? handleClear : undefined}
       />
     </SelectButtonRoot>
   );
-- 
GitLab