diegomedina248 commented on code in PR #19902:
URL: https://github.com/apache/superset/pull/19902#discussion_r863128127


##########
superset-frontend/src/explore/components/controls/ControlPopover/ControlPopover.tsx:
##########
@@ -89,24 +98,50 @@ const ControlPopover: React.FC<PopoverProps> = ({
 
   const handleOnVisibleChange = useCallback(
     (visible: boolean) => {
-      if (props.visible === undefined) {
+      if (visible === undefined) {
         changeContainerScrollStatus(visible);
       }
 
+      setVisible(!!visible);
       props.onVisibleChange?.(visible);
     },
     [props, changeContainerScrollStatus],
   );
 
+  const handleDocumentKeyDownListener = useCallback(
+    (event: KeyboardEvent) => {
+      if (event.key === 'Escape') {
+        setVisible(false);
+        props.onVisibleChange?.(false);

Review Comment:
   To control the popover state in this component, to enable closing on escape.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to