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

Tree freezes when used in controlled mode with motion and expandAction="click" #684

Open
slax57 opened this issue Dec 14, 2022 · 0 comments

Comments

@slax57
Copy link

slax57 commented Dec 14, 2022

Hi,

When using rc-tree in controlled mode, with some animations (with the motion prop), and with expandAction="click", then the Tree gets stuck whenever you click on a leaf.
When that happens, you can no longer expand or collapse the nodes.
The only way out is to trigger a re-render of the Tree by some external event, such as a drag-and-drop or clicking a button that changes the tree state.

This can be really troubling for the end user, as they think the app is broken.

rc-tree-bug-expand-motion

Here is a codesandbox that reproduces the issue: https://codesandbox.io/s/lucid-frog-mks62z?file=/App.jsx

It is based on the basic-controlled example, to which I applied the following changes:

  1. Remove onCheck, checkedKeys, onSelect and selectedKeys props
  2. Add expandAction="click"
  3. Add motion={motion} with some style (from the animation example)

Steps to reproduce:

  1. Expand all nodes until you come to a leaf
  2. Click on the leaf title
  3. Nodes can no longer be expanded nor collapsed

rc-tree version: 5.7.0

Thanks for your help!

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