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

actionbar: entries get swapped between the dropdowns of consecutively clicked actiongroups #5337

Closed
tiktok7 opened this issue Aug 19, 2017 · 2 comments

Comments

@tiktok7
Copy link
Contributor

tiktok7 commented Aug 19, 2017

Versions

  • Python: 3.4.3
  • OS: Linux-3.13.0-24-generic-x86_64
  • Kivy: 1.10.1.dev0
  • Kivy installation method: manual (git repo)

Description

Steps to recreate the problem

  1. Run python3 ./kivy/uix/actionbar.py
  2. Quickly click Group1 and Group2 alternately until the options from one menu show up in the other

Code and Logs

Having debugged the events, it appears that the problem is multiple calls of the ActionGroup._toggle_dropdown(). Both the on_release and dismiss events trigger the same _toggle_dropdown. The result is that the event is called three times so the is_open property is set incorrectly.

@tiktok7
Copy link
Contributor Author

tiktok7 commented Aug 19, 2017

proposed solution #5338

@KeyWeeUsr
Copy link
Contributor

I've noticed the bug too, however I believe that those lines aren't entirely bad. Instead, it appears to me that there was a design flaw since the introduction of the DropDown widget and that's self.dismiss() in both on_touch_down and in on_touch_up.

It's not like that's bad per se, however on_dismiss event is triggered in both of them, which quickly falls down with the current implementation of Spinner/DropDown-ish like behavior that binds to that particular event the _toggle_dropdown() function.

In most of the DropDowns I've seen the elements are removed when the touch/click is released, so I tried that. When I removed the self.dismiss() part for DropDown.on_touch_down(), it made stuff better, but I still think the widget itself needs a rewrite as it doesn't use anything but DropDown from the Spinner it currently uses.

This is fixed in the linked PR #5339.

@tiktok7 tiktok7 closed this as completed Aug 19, 2017
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

2 participants