looker-open-source/components

Popover onClose not working

Closed this issue · 6 comments

Hello,

I can not make the Popover's onClose prop to work

https://codesandbox.io/s/prod-worker-qjxh8f?file=/src/index.tsx

Hi @kufelkamil thank you for logging this bug, we'll get it fixed ASAP. In the meantime one of these workarounds may be useful to you:

Fully controlled Popover: https://codesandbox.io/s/blazing-sea-lfswdo
onClose called when "Done" button is clicked: https://codesandbox.io/s/modern-bush-fwqy0g

Hi @mdodgelooker, thank you very much for providing the workarounds, I will go with one of them :)

Our internal ticket number is 227215288.

Also the DialogContext is not working, I don't know if it's related

import { DialogContext } from '@looker/components'
// ...
const { closeModal } = useContext(DialogContext)

return (
  <PopoverFooter closeButton={<Button onClick={closeModal}>Done</Button>}>
  // ...
  </PopoverFooter>
)

Chrome says the closeModal attached is noop, any idea why ?

@gaillota yes, this is the same issue and this will also be resolved when we resolve this issue - thanks for the example.

@kufelkamil and @gaillota both issues are resolved in v4.1.1.