kivymd / KivyMD

KivyMD is a collection of Material Design compliant widgets for use with Kivy, a framework for cross-platform, touch-enabled graphical applications. https://youtube.com/c/KivyMD https://twitter.com/KivyMD https://habr.com/ru/users/kivymd https://stackoverflow.com/tags/kivymd
https://kivymd.readthedocs.io
MIT License
2.21k stars 664 forks source link

MDButton receives touch events even in the disabled state #1618

Open pyLover2050 opened 7 months ago

pyLover2050 commented 7 months ago

Description of the Bug

The button functions like a normal button even when disabled, with the MDButtonText area not receiving touch events outside its area. Thus, the button still receives touch events and callbacks as if it were enabled.

Code and Logs

from kivymd.app import MDApp
from kivy.lang import Builder

KV = '''
MDBoxLayout:
    MDBoxLayout:
        size_hint_x: .5
    MDBoxLayout:
        size_hint_x: .5
        MDButton:
            disabled: True
            on_release: print('Button pressed!')
            MDButtonText:
                text: 'disabled'
'''

class MyApp(MDApp):
    def build(self):
        return Builder.load_string(KV)

MyApp().run()

Screenshots

here is a video

https://github.com/kivymd/KivyMD/assets/113103699/d835455f-d03c-441c-8b9c-a4c914b72293

Versions

pyLover2050 commented 7 months ago

same problem with MDExtendedFabButton.