Hi everyone
What I’m trying to do:
Have a toggle switch visible as expected based on the visibility status of its container (called filter_option_container)
It’s the toggle switch from here: Toggle Switch and Progress Bar
What I’ve tried and what’s not working:
I’ve tried adding the toggle switch as a component in the container, setting the container to hidden by default, and then using a button with code to make the container visible when the button is clicked. The button click works, and the container becomes visible with all its other components EXCEPT the toggle switch, which, althrough set to visible, cannot be seen. It then becomes visible when I click on its position.
Code Sample (the normal code for hiding and showing a container based on a button click):
def filter_expand_button_click(self, **event_args):
if self.filter_option_container.visible == False:
self.filter_option_container.visible = True
self.filter_expand_button.text = 'Hide'
else:
self.filter_option_container.visible = False
self.filter_expand_button.text = 'Set filters'
pass
The toggle switch will be a lot nicer for users to use than a checkbox so I am hoping not to need to default to that. Any help would be much appreciated.
Thanks,
Richard