* fix: popover does not close when clicking outside in SwitchSpace. (#720)

This commit is contained in:
Auxa
2025-02-13 01:14:21 +09:00
committed by GitHub
parent 7121771f92
commit ae842f94d0

View File

@ -13,7 +13,7 @@ interface SwitchSpaceProps {
export function SwitchSpace({ spaceName, spaceSlug }: SwitchSpaceProps) { export function SwitchSpace({ spaceName, spaceSlug }: SwitchSpaceProps) {
const navigate = useNavigate(); const navigate = useNavigate();
const [opened, { close, open }] = useDisclosure(false); const [opened, { close, open, toggle }] = useDisclosure(false);
const handleSelect = (value: string) => { const handleSelect = (value: string) => {
if (value) { if (value) {
@ -29,6 +29,7 @@ export function SwitchSpace({ spaceName, spaceSlug }: SwitchSpaceProps) {
withArrow withArrow
shadow="md" shadow="md"
opened={opened} opened={opened}
onChange={toggle}
> >
<Popover.Target> <Popover.Target>
<Button <Button