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

onSelect event not working for MenuItem #175

Open
hnagrath09 opened this issue Jun 19, 2022 · 1 comment
Open

onSelect event not working for MenuItem #175

hnagrath09 opened this issue Jun 19, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@hnagrath09
Copy link

hnagrath09 commented Jun 19, 2022

Describe the bug
onSelect event of MenuItem is giving following error message

index.mjs:8716 Uncaught TypeError: Cannot read properties of undefined (reading 'disabled')
    at Object.onItemClick (index.mjs:8716:28)
    at onItemClick (index.mjs:9053:17)
    at HTMLDocument.eventHandler (dev.js:349:47)

To Reproduce

Using following implementation for Menu,

      <Menu>
        <MenuTrigger
          as={Avatar}
          size="xs"
          name={user()?.name}
          cursor="pointer"
        />
        <MenuContent>
          <MenuItem fontSize="$sm" onSelect={logout}>
              Logout
          </MenuItem>
        </MenuContent>
      </Menu>

Using v0.6.2

@fabien-ml fabien-ml added the bug Something isn't working label Jun 19, 2022
@fabien-ml
Copy link
Collaborator

Hi, thanks for reporting the issue. However i'm not able to reproduce the bug, the code snippets above works (https://codesandbox.io/s/vigilant-chaplygin-9lml72?file=/src/App.tsx)

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

2 participants