-
I'm trying to create a fixed button that can open or close a I have an There are a few work arounds but they all involve code duplication. I'm hoping to find a solution where one button can toggle the dialog
https://codesandbox.io/s/headless-ui-playground-forked-rwzqqy?file=/src/App.js:393-412 |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
I have run into this too... setup is a menu button thats The Dialog doesn't close because of its I've hacked my way around it before, although I'm struggling to do so again now, and so would love to know if there's a recommended approach to handle this? |
Beta Was this translation helpful? Give feedback.
-
I ultimately switched to
|
Beta Was this translation helpful? Give feedback.
-
use <button type="button" onMouseUp={() => setIsOpen(!isOpen)}>
toggle dialog
</button> |
Beta Was this translation helpful? Give feedback.
I ultimately switched to
Popover
fromDialog
and exposed theclose
prop. The popover button remains fixed and you are able to add an overlay if necessary. It seems to be the solution I was looking for.