community icon indicating copy to clipboard operation
community copied to clipboard

ModalView: on_dismiss runs before on_open if user dismisses popup before opening animation completes

Open Alspb opened this issue 3 years ago • 2 comments

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: xxx label.
  • [ ] Applied the api-deprecation or api-break label.
  • [ ] Applied the release-highlight label to be highlighted in release notes.
  • [ ] Added to the milestone version it was merged into.
  • [ ] Unittests are included in PR.
  • [ ] Properly documented, including versionadded, versionchanged as needed.

Alspb avatar Jan 11 '22 22:01 Alspb

Related issue https://github.com/kivy/kivy/issues/5540.

pythonic64 avatar Feb 18 '22 00:02 pythonic64

How about cancel animation and cancel "animation_done" callback ?

NomadDemon avatar Jul 17 '22 20:07 NomadDemon