AmoghAtreya opened a new pull request, #44959:
URL: https://github.com/apache/superset/pull/44959

   ### SUMMARY
   ControlPopover accepted `open` but copied it into local state. Trigger 
clicks and Escape always called `setVisible`, so a parent that passed 
`open={false}` (to veto opening, or because its own state had not changed) 
still got an open popover. The prop was only re-synced when its value changed, 
so setting the same value again could not close it either.
   
   When `open` is provided, visibility is now derived from that prop and 
handlers only emit `onOpenChange`. Local state is used only in the uncontrolled 
case.
   
   Fixes #44916
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   N/A — behavioral fix; no visual design change.
   
   ### TESTING INSTRUCTIONS
   1. Render `<ControlPopover open={false} trigger="click" 
content="x">trigger</ControlPopover>` and click the trigger. The popover should 
stay closed and `onOpenChange(true)` should fire.
   2. Render with `open={true}` and press Escape. The popover should stay open 
and `onOpenChange(false)` should fire.
   3. Open a typical Explore control popover (e.g. filter, metric, or date 
filter) and confirm click-to-open, click-outside, and Escape still work in the 
uncontrolled/parent-controlled flows.
   
   ### ADDITIONAL INFORMATION
   - [x] Has associated issue: #44916
   - [ ] Required feature flags:
   - [] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API


-- 
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