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.55k stars 794 forks source link

Property 'className' does not exist on type 'IntrinsicAttributes & SelectPortalProps'. #2805

Open gnoyixiang opened 6 months ago

gnoyixiang commented 6 months ago

Bug report

Current Behavior

Getting this typescript error when using Select.Portal "Property 'className' does not exist on type 'IntrinsicAttributes & SelectPortalProps'." image

Expected behavior

Since className is actually passed down to Portal component and the DOM. Since it is used, this prop should be accepted in the Select.Portal props

Reproducible example

Replit Template

Suggested solution

Revert the changes made in this PR interface SelectPortalProps extends Omit<PortalProps, 'asChild'> {

Your environment

"devDependencies": {
  "@types/react": "^18.0.15",
  "@types/react-dom": "^18.0.6",
  "@vitejs/plugin-react": "^2.0.0",
  "react": "^18.2.0",
  "react-dom": "^18.2.0",
  "typescript": "^4.7.4",
  "vite": "^3.0.4"
},
"dependencies": {
  "@radix-ui/colors": "^3.0.0",
  "@radix-ui/react-icons": "^1.3.0",
  "@radix-ui/react-select": "^2.0.0",
  "classnames": "^2.5.1"
}
joaom00 commented 4 months ago

why do you want to pass className to Select.Portal? Selected.Portal will be merged with Select.Content so you can pass the className directly to Select.Content