Open simpleneeraj opened 10 months ago
I had the same problem, I think its related to next.js server/client rendering feature.
Fixed mine by extracting Popoever to a new component using 'use client';
directive. Also you may need to run rm -rf .next
occasionally.
Your UIIconButton
component must receive ref
in order to work or, you can use the default NextUi Button
Component or any tag like a normal <button>
.
Your UIIconButton
component must be something like this to work as expected:
// UIIconButton.tsx
import { forwardRef } from 'react'
type Props = React.ComponentProps<'button'>
export const UIIconButton = forwardRef<HTMLButtonElement, Props>(function UIIconButton(props, ref) {
return <button {...props} ref={ref} />
})
NextUI Version
2.2.9
Describe the bug
I've integrated the Dropdown component from Next UI using the code provided in the documentation: Component Link → https://nextui.org/docs/components/dropdown. However, within my code, the dropdown menu isn't positioning correctly.
Please review this code,
Next UI website screenshot
My webapp screenshot
My main issue position of dropdown
Your Example Website or App
No response
Steps to Reproduce the Bug or Issue
Create a new Next.js project or use an existing one. Install the nextui package: npm install nextui
Use the code provided in the Next UI documentation for the Dropdown component: https://nextui.org/docs/components/dropdown Ensure you replace the "content" prop with your desired dropdown content (e.g., list items, buttons).
Add the component to your JSX code wherever you want the dropdown to appear. Ensure the component has a proper trigger element, such as a button or text link.
Click over the trigger element (e.g., button) to activate the dropdown. Observe how the dropdown menu is positioned.
Expected behavior
dropdown menu should be positioned correctly
Screenshots or Videos
https://github.com/nextui-org/nextui/assets/69778720/c7a5687c-9ed5-442a-a3a9-c5f9101952b5
Operating System Version
Windows 10
Browser
Chrome