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

Fast expand/collapse of folder leads to inconsistent state #1029

Closed
zadam opened this issue Aug 25, 2020 · 1 comment
Closed

Fast expand/collapse of folder leads to inconsistent state #1029

zadam opened this issue Aug 25, 2020 · 1 comment
Labels

Comments

@zadam
Copy link

zadam commented Aug 25, 2020

Hello, I stumbled upon a bug which leads to inconsistent expanded/collapsed state of folder nodes when quickly toggling between expanded and collapsed state using keyboard shortcuts.

Could be that the problem lies in the fact that expand is triggered before the animation of the preceding collapse action has not finished yet.

Expected and Actual Behavior

See here how the inconsistent state looks like:

image

Expander is expanded, but children are not shown. Also note the debug message in console.

And corresponding (inconsistent) DOM view:

image

Steps to Reproduce the Problem

You can use http://jsfiddle.net/mar10/KcxRd/ to test this

  1. Activate "folder 3" node
  2. Very quickly in succession press right arrow (expand), left arrow (collapse), right arrow (expand)
  3. Observe inconsistent state. Sometimes you need multiple tries to get this effect

Environment

  • Browser type and version: Firefox 79, but I saw this happen also on Chrome 84
  • jQuery and jQuery UI versions: jQuery 3.5.1
  • Fancytree version: 2.36.1
    enabled/affected extensions:
@mar10 mar10 added the bug label Aug 27, 2020
@mar10
Copy link
Owner

mar10 commented Aug 27, 2020

The problem occurs when a second expand/collapse request is triggered while the previous animation is still running.
I changed the behavior so that in this case setExpanded() is ignored, with a warning.

(A better solution may be to stop the previous animation and then apply the new request, however this would be much more difficult to implement. Also, the first caller may wait for and process the done()callback of the original promise.)

@mar10 mar10 closed this as completed in 3d6e1a4 Aug 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants