Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] - Using DropdownItem as Link will open two windows simultaneously. #2935

Open
baijunjie opened this issue May 3, 2024 · 1 comment
Labels
📦 Scope : Components Related to the components 🐛 Type: Bug Something isn't working

Comments

@baijunjie
Copy link

baijunjie commented May 3, 2024

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;
image

Upon clicking, two windows will open simultaneously.

image

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.
image

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

Copy link

linear bot commented May 3, 2024

@wingkwong wingkwong added 🐛 Type: Bug Something isn't working 📦 Scope : Components Related to the components labels May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 Scope : Components Related to the components 🐛 Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants