community
community copied to clipboard
ModalView: on_dismiss runs before on_open if user dismisses popup before opening animation completes
The reason is that on_open only runs when opening animation completes, which can take some time if _anim_duration parameter is high.
Such a behavior seems counterintuitive, it's expected that on_open should always precede on_dismiss.
Also it worth noting that dismissing doesn't stop opening animation, so both animations run together.
To avoid these issues it's suggested not to dismiss the popup if opening animation is in progress and vice versa not to open if dismissing animation still runs.
Maintainer merge checklist
- [ ] Title is descriptive/clear for inclusion in release notes.
- [ ] Applied a
Component: xxxlabel. - [ ] Applied the
api-deprecationorapi-breaklabel. - [ ] Applied the
release-highlightlabel to be highlighted in release notes. - [ ] Added to the milestone version it was merged into.
- [ ] Unittests are included in PR.
- [ ] Properly documented, including
versionadded,versionchangedas needed.
Related issue https://github.com/kivy/kivy/issues/5540.
How about cancel animation and cancel "animation_done" callback ?