textual
textual copied to clipboard
Investigate disabled button state
Disabled buttons still have a hover state, even with a hack to watch_mouse_hover.
Investigate why this occurs, and fix or implement a better solution.
overriding get_pseudo_classes in the Button class seems to work
def get_pseudo_classes(self) -> Iterable[str]:
"""Pseudo classes for a widget.
Returns:
Iterable[str]: Names of the pseudo classes.
"""
for cls in super().get_pseudo_classes():
if cls == 'hover' and self.disabled:
continue
yield cls
It doesn't seem to be the case anymore @willmcgugan.
Running textual run docs/examples/widgets/button.py --dev and hovering over the buttons - nothing happens.
Ok, assuming fixed. Re-open if it reoccurs.
Did we solve your problem?
Glad we could help!