Comments (5)
This issue is self-inflicted: your spacebar keypress event propagates to the dropdown menu item, which prevents default on click.
The dropdown and dialog should be composed differently to avoid that: #342 (comment)
from themes.
Dear vlad moroz, I'm unable to access the URL of final updated code into previous solution; could you please verify and provide an updated link?
from themes.
@mr-sazzad your code would look like this.
You'd have to make your LoginDialog
component controlled and pass open
and onOpenChange
props into the Dialog
inside.
const Profile = () => {
const [dialogOpen, setDialogOpen] = useState(false);
return (
<>
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button
variant="outline"
className="rounded-full p-0 flex justify-center items-center overflow-hidden border-0"
>
<Avatar>
<AvatarImage src="../../images/profile.svg" alt="profile-image" />
<AvatarFallback>AW</AvatarFallback>
</Avatar>
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent className="w-56">
<DropdownMenuItem
className="w-full list-none m-1"
onSelect={() => setDialogOpen(true)}
>
Sign in
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
<LoginDialog open={dialogOpen} onOpenChange={setDialogOpen} />
</>
);
};
from themes.
Can i have to remove DialogTrigger from LoginDialog?
from themes.
Yeah it's not required in this case
from themes.
Related Issues (20)
- Cannot find module `@radix-ui\themes\dist\cjs` HOT 2
- [Switch] Issue- Screen readers announce "Button" instead of "Switch". HOT 1
- [Tooltip] Issue: Text inside is based on theme HOT 1
- Button vanishes after adding type HOT 1
- [Dialog] Issue
- [Avatar] Conditionally set color HOT 3
- [Question] Why separate layout, margin and another props? HOT 1
- [DropdownMenu] Issue- Dropdown can't be navigated with TAB key HOT 2
- Left align Radio Card HOT 1
- Select Trigger Color Prop Broken HOT 1
- Improve documentation on customizing the CSS variables (e.g. the Container max widths) HOT 1
- [SegmentedControl] Disabled items not supported HOT 1
- [Question] accordions expanding with code HOT 1
- [Alert Dialog] - dialog has no close button
- [RadioCards] Issue with import RadioCard HOT 1
- How do I trigger a Dialog from an outside component?
- [Feature request] Export components prop defs constants HOT 3
- [Feature Request] Combobox HOT 2
- [Popover] Button's hover effect is not working in Popover.Trigger HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from themes.