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

[ui] crash with nested dropdown components #349

Open
Noaaan opened this issue Feb 3, 2025 · 0 comments
Open

[ui] crash with nested dropdown components #349

Noaaan opened this issue Feb 3, 2025 · 0 comments

Comments

@Noaaan
Copy link
Member

Noaaan commented Feb 3, 2025

This has changed a bit. Ignoring the checkbox-specific changes, the .nested() call now requires sizing.
There is also some pitfall with the nested component, as it currently crashes when hovered 🤔
E.G.:

Components.dropdown(Sizing.content())
    .button(Text.literal("Option 1"), button -> {
        // Handle button click event
    })
    .checkbox(Text.literal("Option 2"), false, ignored -> {})
    .nested(Text.literal("Submenu"), Sizing.content(), submenu -> {
        submenu.button(Text.literal("Submenu Option"), button -> {
            // Handle submenu button click event
        });
    })
    .closeWhenNotHovered(true)
    .padding(Insets.of(5))
    .surface(Surface.TOOLTIP)

Originally posted by @Noaaan in wisp-forest/docs#12 (comment)

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