[BUG] - can't open dropdown in production
NextUI Version
2.3.2
Describe the bug
can't open drodpdown in production, and you can also test it on your website, it can't be opened, even though my application is live
Your Example Website or App
No response
Steps to Reproduce the Bug or Issue
- go to https://nextui.org/docs/components/dropdown
- click one of the demo dropdowns
Expected behavior
it should be open
Screenshots or Videos
No response
Operating System Version
windows
Browser
Chrome
preliminary findings:
- For NextUI element in dropdown trigger:
- failed in prod storybook & prod doc site local storybook
- works in local storybook & local doc site (
mainbranch)
- For non-NextUI element in dropdown trigger:
- failing. due to filterDOMProps remove the events
- For popover, it shows at the end of the page or somewhere else
Hi,
I test the same behavior.
A better explanation for this issue is that the dropdown is open in production also, but it is placed far below (bottom) on the page.
in my case, dropdown item ignores onPress/onClick events
@YoFiq onpress/onclick issue on dropdown has been addressed in 2.3.3. Are you using this version?
@wingkwong i used 2.3.2, and dropdown just ignored onPress/onClick events in menu items on version 2.3.3 dropdown not displayed menu at all
downgraded to this versions and everything works fine "@nextui-org/react": "2.2.10", "framer-motion": "^10.2.4",
@YoFiq Can you share your dropdown code? I used 2.3.3 and am able to open the menu. Wondering if there is some edge cases.
export const DropdownTest = ({isCondition, handleTest1, handleTest2, handleTest3}: Props) => {
const menuOptions = useMemo(() => {
const options = [
{
key: 'title_1',
title: 'title 1',
onPress: () => {
handleTest1();
handleTest2();
}
},
{
key: 'title_2',
title: 'title 2',
onPress: () => {
handleTest2();
handleTest3();
}
}
];
if (isCondition) {
options.push({
key: 'title_3',
title: 'title 3',
onPress: () => {
handleTest1();
handleTest3();
}
});
}
return options;
}, [isCondition, handleTest1, handleTest2, handleTest3]);
const getOptionsItems = () => {
const dropdownChildren = menuOptions.map((menu) => (
<DropdownItem key={menu.key} onPress={menu.onPress}>
{menu.title}
</DropdownItem>
));
return { children: dropdownChildren };
};
const dropdownChildren = getOptionsItems();
return (
<div className="flex flex-row items-center justify-between">
<Dropdown
classNames={{
content: 'bg-lightUI-6 text-lightUI-1 rounded-lg',
trigger: 'z-0 outline-none'
}}
>
<DropdownTrigger>
<div className="flex h-10 min-h-10 w-10 min-w-10 items-center justify-center rounded-lg bg-lightUI-9 2xl:h-11 2xl:w-11">
<MoreVert height={20} width={20} />
</div>
</DropdownTrigger>
<DropdownMenu
classNames={{
base: 'p-0'
}}
aria-label="Active menu"
itemClasses={{
title: 'group-data-[hover=true]:text-blue-light-hovered ',
base: '!text-lightUI-1 text-sm py-2 px-3 [&>svg]:data-[hover=true]:text-blue-light-hovered [&>span>svg]:!hidden font-poppins data-[hover=true]:bg-lightUI-8'
}}
{...dropdownChildren}
/>
</Dropdown>
</div>
);
};
@YoFiq we just released a new bug fix. Can you try on 2.3.4?
Fixed in v2.3.4