File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
site/src/components/Popover Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -67,9 +67,9 @@ export const Popover: FC<PopoverProps> = (props) => {
67
67
const [ uncontrolledOpen , setUncontrolledOpen ] = useState ( false ) ;
68
68
const triggerRef : TriggerRef = useRef ( null ) ;
69
69
70
- // This doesn't guarantee that we'll always close any popovers when the
71
- // user switches tabs when the component is being controlled, but this is
72
- // basically the most we can do from this component
70
+ // Helps makes sure that popovers close properly when the user switches to
71
+ // a different tab. This won't help with controlled instances of the
72
+ // component, but this is basically the most we can do from here
73
73
useEffect ( ( ) => {
74
74
const closeOnTabSwitch = ( ) => setUncontrolledOpen ( false ) ;
75
75
window . addEventListener ( "blur" , closeOnTabSwitch ) ;
You can’t perform that action at this time.
0 commit comments