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

Event object isn't correctly passed to Dropdown.Item click handler #838

Open
jjchrisdiehl opened this issue Mar 22, 2024 · 0 comments
Open

Comments

@jjchrisdiehl
Copy link

Describe the bug
The event object isn't properly passed to the Dropdown.Item onClick prop which leads to undefined when logged.

To Reproduce
Steps to reproduce the behavior:

  1. Add a Dropdown component
  2. Add a click handler function to Dropdown.Item's onClick prop
  3. Try logging e or event
  4. See error

Expected behavior
I expected to be able to access the e prop within the handler function and console.log the event object like so:
image

But unfortunately it logs out undefined.

Strangely, by removing the e prop and simply console.loging the event keyword I am able to access the event object, though my IDE marks it as deprecated:

image

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: Chrome
  • Version: 121.0.6167.184 (Official Build) (arm64)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant