Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MDCheckbox with group resizes incorrectly on double click #1732

Open
MrHxID opened this issue Sep 2, 2024 · 0 comments
Open

MDCheckbox with group resizes incorrectly on double click #1732

MrHxID opened this issue Sep 2, 2024 · 0 comments

Comments

@MrHxID
Copy link

MrHxID commented Sep 2, 2024

Description of the Bug

I've found a bug in the way the MDCheckbox gets resized. Take the following example:

from kivymd.app import MDApp
from kivymd.uix.selectioncontrol import MDCheckbox

class MainApp(MDApp):
    def build(self):
        return MDCheckbox(group='test')

if __name__ == '__main__':
    MainApp().run()

Make sure that the MDCheckbox has a non-empty group. The group can also be 'root' or 'child', but not ''.
To produce the bug, the checkbox has to be inactive. Then double-click quickly on the checkbox. If timed correctly the box will disappear or will show smaller than usual. To reproduce this issue more easily, you can also set the duration of self.check_anim_in to 1 in the MDCheckbox.__init__ method. If you click on the box while check_anim_in is running then the box will get stuck at the size
it is currently at.

Proposed solution

To fix this issue, the easiest way is to put

self.scale_value_x = 1
self.scale_value_y = 1

at the start of the MDCheckbox.on_state method.

Versions

  • OS: Windows 10
  • Python: 3.10.11
  • Kivy: 2.3.0
  • KivyMD: 2.0.1.dev0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant