-
Notifications
You must be signed in to change notification settings - Fork 3
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
Menu trigger not opening menu #333
Labels
O-Occasional
Affects or can be seen by some users regularly or most users rarely
P-Web
Platform Web
S-Minor
Impairs non-critical functionality or suitable workarounds exist
T-Defect
Comments
Taking a timeboxed look at this: you can reproduce this by putting a tooltip on any menu trigger. |
Testing with the following story: import React, { ComponentPropsWithoutRef, forwardRef, Suspense, useState } from "react";
import { Meta, StoryObj } from "@storybook/react";
import UserProfileIcon from "@vector-im/compound-design-tokens/assets/web/icons/user-profile";
import { Menu as MenuComponent } from "./Menu";
import { MenuItem } from "./MenuItem";
import { Button } from "../Button/Button";
import { Tooltip } from "../Tooltip/Tooltip";
import { TooltipProvider } from "../Tooltip/TooltipProvider";
type Props = Omit<
React.ComponentProps<typeof MenuComponent>,
"open" | "onOpenChange" | "trigger" | "align" | "children"
>;
const TooltipButton = forwardRef<HTMLButtonElement, ComponentPropsWithoutRef<typeof Button>>((props, ref) => {
return (
<Tooltip description='This is a tooltip'>
<Button ref={ref} {...props}>
Open menu
</Button>
</Tooltip>
)
})
const Template: React.FC<Props> = (args) => {
const [open, setOpen] = useState(true);
return (
<Suspense>
<TooltipProvider>
<MenuComponent
{...args}
open={open}
onOpenChange={setOpen}
trigger={<TooltipButton />}
align="start"
>
<MenuItem Icon={UserProfileIcon} label="Profile" onSelect={() => {}} />
</MenuComponent>
</TooltipProvider>
</Suspense>
);
};
const meta = {
title: "Menu2",
component: Template,
tags: ["autodocs"],
argTypes: {},
args: {},
} satisfies Meta<typeof Template>;
export default meta;
type Story = StoryObj<typeof meta>;
export const WithTooltip: Story = {
args: { title: "Today's Menu" },
}
|
Setting this aside for now. Conclusion is that something seems to be wrong with Tooltip's handling of refs post-React-19 (but why is that affecting Element Web, which is on React 18?) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
O-Occasional
Affects or can be seen by some users regularly or most users rarely
P-Web
Platform Web
S-Minor
Impairs non-critical functionality or suitable workarounds exist
T-Defect
Platform
Package version
Description
See test failures on element-hq/element-web#28708
Screen.Recording.2025-01-07.at.15.21.25.mov
The text was updated successfully, but these errors were encountered: