nextui
nextui copied to clipboard
[BUG] - Using `DropdownItem` as `Link` will open two windows simultaneously.
NextUI Version
2.3.6
Describe the bug
import {
Dropdown,
DropdownTrigger,
DropdownMenu,
DropdownItem,
Button,
Link,
} from '@nextui-org/react';
function App() {
return (
<>
<Dropdown>
<DropdownTrigger>
<Button variant="bordered">Open Menu</Button>
</DropdownTrigger>
<DropdownMenu aria-label="Static Actions">
<DropdownItem as={Link} target="_blank" href="https://google.com">
Open Google
</DropdownItem>
</DropdownMenu>
</Dropdown>
</>
);
}
export default App;
Upon clicking, two windows will open simultaneously.
It's important to note that, by default, the browser will block one window, so it may seem like only one window is opened. However, if the browser's blocking is disabled, two windows will open.
Your Example Website or App
https://stackblitz.com/edit/vitejs-vite-pbo2fn?file=package.json,src%2FApp.jsx&terminal=dev
Steps to Reproduce the Bug or Issue
none
Expected behavior
Open only one window.
Screenshots or Videos
No response
Operating System Version
macOS
Browser
Chrome