csandman / chakra-react-select

A Chakra UI themed wrapper for the popular library React Select

Home Page:https://www.npmjs.com/package/chakra-react-select

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Can't add custom props for MenuList via innerProps

JasonasIgn opened this issue · comments

Description

When I add custom properties on innerProps for MenuList (like data-testid) they are ignored. It seems they aren't exploded in MenuList component. The original react-select library allows that.

chakra-react-select Version

3.3.7

Link to Reproduction

https://codesandbox.io/s/react-select-playground-forked-nqwxik?file=/src/index.tsx

TypeScript?

  • Yes I use TypeScript

Steps to reproduce

No response

Operating System

  • macOS
  • Windows
  • Linux
  • iOS/iPadOS
  • Android

Additional Information

No response

Thanks for pointing this out, and the reproduction! I'll take a look at why this is happening. Pretty sure I have a good idea though.

Ok this should be fixed in the most recent version pushed for v3 and v4.

Here's A working example on v3 which you mentioned using in your issue: https://codesandbox.io/s/chakra-react-select-v3-innerprops-db3dno

And here's a working version of the sandbox you provided which is on v4: https://codesandbox.io/s/chakra-react-select-innerprops-wje4q7?file=/src/index.tsx

If you run into any other situations with this problem, let me know! I think I added the innerProps forwarding to all of the components that had it in the original library, but if I missed one please feel free to reach out.