In my case, I put a form inside the DropdownMenu.Item of Radix Primitives' Dropdown Menu component, I was able to solve this by applying asChild={true} to it.
DropdownMenu.Item
asChild={true}
<DropdownMenuItem asChild={true}> <form> ... </form> </DropdownMenuItem>