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

next: Menubar -> onOpenChange only fired on menu-close and onCloseAutoFocus is never fired #1018

Open
jithus-yavanika opened this issue Dec 24, 2024 · 2 comments

Comments

@jithus-yavanika
Copy link

Describe the bug

onOpenChange in <Menubar.Menu> is fired only on closing the menu.
And onCloseAutoFocus in <Menubar.Content> is never fired.

I do get squiggly lines in VS Code though.
image
Not sure if this helps.

Reproduction

https://github.com/jithusnair/bits-ui-next-menubar-repro

Logs

No response

System Info

System:
    OS: Windows 11 10.0.26100
    CPU: (16) x64 AMD Ryzen 7 5800H with Radeon Graphics
    Memory: 6.17 GB / 15.35 GB
  Binaries:
    Node: 20.18.1 - C:\Program Files\nodejs\node.EXE
    npm: 10.9.2 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (127.0.2651.74)
    Internet Explorer: 11.0.26100.1882

Severity

annoyance

@huntabyte
Copy link
Owner

So with the menus within a menubar, you would want to use the value/onValueChange on Menubar.Root to determine which menu is open (the menu with that corresponding value)

@jithusnair
Copy link

Issue was posted from a different account and sorry about the late response.

I was trying out next and on the docs it mentioned onOpenChange on Menubar.Menu and onCloseAutoFocus on Menubar.Content.

I was trying to determine the open and close state of the menu to:

  • Run a function to disable a few menu items on menu-open.
  • Focus an input, on menu-close.

I'm not able to handle the latter case with onValueChange.

I'm not sure if the docs are out of sync in 'next'. But it would be awesome if the functions mentioned in the docs are available.

Regardless, thank you for this library.❤️

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

3 participants