radix-ui / primitives

Radix Primitives is an open-source UI component library for building high-quality, accessible design systems and web apps. Maintained by @workos.
https://radix-ui.com/primitives
MIT License
15.86k stars 822 forks source link

'aria-hidden' cannot be used in <React.fragment> in the dropdown menu. #3211

Open Kimhansoool opened 1 week ago

Kimhansoool commented 1 week ago

Bug report

Current Behavior

When migration to Next15 and React19, an error appears saying that 'aria-hidden' cannot be used in . After searching the radix-ui menu components package code, I found that 'aria-hidden' was added whild return hideothers in MenuRootContentModal.

image

image https://github.com/radix-ui/primitives/blob/74b182b401c8ca0fa5b66a5a9a47f507bb3d5adc/packages/react/menu/src/Menu.tsx#L258

image https://github.com/theKashey/aria-hidden/blob/52c7374abb9fb0a348c63b9ff613a575868cec62/src/index.ts#L174

Reproducible example

Using dropdown menu package in next15...

Your environment

Software Name(s) Version
Radix Package(s) dropdown menu ^2.1.1
React n/a 19.0.0-rc-45804af1-20241021
Next n/a 15.0.1
Browser chrome
Assistive tech
Node n/a 20.12.2
npm/yarn pnpm 8.14.1
Operating System window 11
V-iktor commented 4 days ago

I am also getting a lot of these errors on Accordion / DropdownMenu

Invalid propdata-statesupplied toReact.Fragment. React.Fragment can only havekeyandchildrenprops.

Invalid propdata-orientationsupplied toReact.Fragment. React.Fragment can only havekeyandchildrenprops.

Dependencies

    "@radix-ui/react-accordion": "^1.2.1",
    "@radix-ui/react-checkbox": "1.1.2",
    "@radix-ui/react-dialog": "^1.1.2",
    "@radix-ui/react-dropdown-menu": "2.1.2",
    "@radix-ui/react-form": "^0.1.0",
    "@radix-ui/react-popover": "1.1.2",
    "@radix-ui/react-radio-group": "^1.2.1",
    "@radix-ui/react-scroll-area": "1.2.0",
    "@radix-ui/react-select": "2.1.2",
    "@radix-ui/react-slot": "1.1.0",
    "@radix-ui/react-tabs": "^1.1.1",
    "@radix-ui/react-tooltip": "1.1.3",