Skip to content

[ui] crash with nested dropdown components #349

@Noaaan

Description

@Noaaan

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions