Skip to content

MenuItem types should allow onFocus #7453

Open
@stefanprobst

Description

@stefanprobst

Provide a general summary of the issue here

following this comment i want to call prefetch when a menu item receives focus:

<MenuItem
  href="/"
  onHoverStart={() => router.prefetch("...")}
  onFocus={() => router.prefetch("...")}
/>

the onFocus handler is internally passed correctly to useMenuItem, but the types are complaining that onFocus is not allowed on MenuItem

🤔 Expected Behavior?

MenuItem types should allow onFocus

https://github.com/adobe/react-spectrum/blob/main/packages/react-aria-components/src/Menu.tsx#L335
https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/menu/src/useMenuItem.ts#L121

😯 Current Behavior

see above

💁 Possible Solution

No response

🔦 Context

No response

🖥️ Steps to Reproduce

n/a

Version

1.5.0

What browsers are you seeing the problem on?

Firefox

If other, please specify.

No response

What operating system are you using?

linux

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    🩺 To Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions