Skip to content
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

[Bug]: Invalid prop: type check failed for prop "onBlur". Expected Function, got Array - DropdownMenuContent & Motion #1726

Open
adarsh4d opened this issue Mar 19, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@adarsh4d
Copy link

Environment

Node version: v18.20.3
Package manager: pnpm@8.15.6
Reka UI version: 2.1.0
Motion-V version: 0.13.0

Link to minimal reproduction

https://stackblitz.com/edit/x7y44ngl-uxmrt3cq

Steps to reproduce

  • Go to this link
  • Open dev tools
  • Click on "Push Me" button

Describe the bug

When using the Motion with DropdownMenuContent it logs a warning about invalid props

Invalid prop: type check failed for prop "onBlur". Expected Function, got Array

Expected behavior

No response

Context & Screenshots (if applicable)

Image

@adarsh4d adarsh4d added the bug Something isn't working label Mar 19, 2025
@zernonia
Copy link
Member

@rick-hup do you think this is warning from motion-v? 😁

@rick-hup
Copy link
Contributor

@zernonia I think the type error occurs because DropdownMenuContent is passing an Array type for onBlur, while the Motion component expects onBlur to be a function.

@zernonia
Copy link
Member

hmm this is weird.. I did a @blur console.log and seems like it's triggering as a Function, not an array.. Need further inspection

@rick-hup
Copy link
Contributor

@zernonia did you set asChild to true?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants