form menu item issue #1791
Unanswered
LucasMobley
asked this question in
Help
Replies: 1 comment 1 reply
-
Hey! Thank you for your question! For a form action, you can use something like this: <form method="POST" action="#">
<Menu.Item>
<button type="submit">
Sign out
</button>
</Menu.Item>
</form> Note that the form is outside of the If that doesn't work, then please provide a reproduction repo so that we can take a look. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What package within Headless UI are you using?
"@headlessui/react": "1.6.6"
What browser are you using?
Tested on Chrome and Safari
Reproduction URL - NA- in new private component library being built.
Describe your issue
I'm passing a form element as a menu item that has a method and a post request. (
Login) In the console I receive a error message "Form submission canceled because the form is not connected." I resolved this error by using the open boolean prop and setting the menu to static and toggling the menu to hidden or flex in tailwind. This works but seems like a workaround solution.Thanks! - Lucas
Beta Was this translation helpful? Give feedback.
All reactions