solara icon indicating copy to clipboard operation
solara copied to clipboard

ToggleButtonsSingle child Button's value overridden by its Tooltip

Open Dfred opened this issue 5 months ago • 3 comments
trafficstars

Expected Behavior

Value set by ToggleButtonsSingle (or passed to the on_value parameter) should always take the value of child Buttons.

Current Behavior

when ToggleButtonsSingle has a child Button with a Tooltip, ToggleButtonsSingle sets the value of that Tooltip's label instead of the Button value.

Steps to Reproduce the Problem

see this pycafe code.

Specifications

  • Solara Version: 1.47.0
  • Platform: Ubuntu amd64
  • Affected Python Versions: 3.12

Dfred avatar Jun 21 '25 06:06 Dfred

Yes, I understand this is desired behaviour, but it would be complex to support this (would require walking through all the child trees). Would it help if you could opt out of this behaviour?

maartenbreddels avatar Jun 25 '25 07:06 maartenbreddels

The need for Tooltips to ToggleButtonsSingle will always remain for us. If solara provides an alternative recipe to make those 2 components work together, please let me know.

Dfred avatar Jun 25 '25 16:06 Dfred

I am not sure if it possible with vuetify actually. MaterialUI I think has (or had) the same issue. I wonder if drawing your own buttons and handling the selection yourself in Python is a good workaround, similar to this: https://github.com/mui/material-ui/issues/36270#issuecomment-2485817225

maartenbreddels avatar Jun 27 '25 09:06 maartenbreddels