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 · May be fixed by #877
Open

Can't use tooltips for children of ToggleButtonsSingle #831

lopezvoliver opened this issue Oct 24, 2024 · 0 comments · May be fixed by #877
Labels
bug Something isn't working

Comments

@lopezvoliver
Copy link
Contributor

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

@iisakkirotko iisakkirotko added the bug Something isn't working label Nov 22, 2024
@iisakkirotko iisakkirotko linked a pull request Nov 25, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants