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

Can't use tooltips for children of ToggleButtonsSingle #831

Open
lopezvoliver opened this issue Oct 24, 2024 · 0 comments
Open

Can't use tooltips for children of ToggleButtonsSingle #831

lopezvoliver opened this issue Oct 24, 2024 · 0 comments

Comments

@lopezvoliver
Copy link

lopezvoliver commented Oct 24, 2024

This is somewhat related to #683

If I try to use tooltips for each Button inside a ToggleButtonsSingle component, the selected value is set to the tooltip value, not the one from the button.

Correct behavior (but no tooltips)

import solara
map_type = solara.Reactive("stack")

@solara.component
def Page():
    with solara.ToggleButtonsSingle(value=map_type):
        solara.Button("Stack", icon_name="mdi-layers-triple", value="stack", text=True)
        solara.Button("Split", icon_name="mdi-arrow-split-vertical", value="split", text=True)

    solara.Text(map_type.value)

Page()

image

Issue when trying to use tooltips

@solara.component
def Page():
    with solara.ToggleButtonsSingle(value=map_type):
        with solara.Tooltip("Stacks each layer on top of each other."):
            solara.Button("Stack", icon_name="mdi-layers-triple", value="stack", text=True)
        with solara.Tooltip("Creates a split in the map that you can move."):
            solara.Button("Split", icon_name="mdi-arrow-split-vertical", value="split", text=True)

    solara.Text(map_type.value)

image

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