Open tpcgold opened 3 months ago
workaround that is at least working for the icon color (still not the content button itself):
with me.content_button(
on_click=self.thumb_up,
# disabled=self.state.voted, # not used due to color change
type="icon",
style=(
me.Style(color="#0064ff") if self.state.rating > 0 else None
),
):
me.icon("thumb_up")
with me.content_button(
on_click=self.thumb_up,
# disabled=self.state.voted, # not used due to color change
type="icon",
style=(
me.Style(background="#0064ff", color="white")
if self.state.rating > 0
else None
),
):
me.icon("thumb_up")
Describe the bug Button coloring hides the icon after updating it's type
To Reproduce use a button and react on a click event e.g.:
this will change the button type as soon as it's pressed, but the bug is: the icon is not shown anymore. the icon will show up if a second message is sent (just for testing purposes this uses the same definition).
Expected behavior The icon should be shown.
Screenshots
Additional context NOTE: the disable button is not used here, as this is not yet configurable in color. (this might be a feature MESOP should implement to have custom "disabling" colors rather than just graying out a disabled button)
In addition the example includes just tumb_up but tumb_down (in the images) is implemented equally