Tree freezes when used in controlled mode with `motion` and `expandAction="click"`
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 48/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- react, typescript
- 領域
- frontend
研究方向
從連結的 CodeSandbox 中的 App.jsx 重現開始,並將其與 basic-controlled 和 animation 範例進行比較。當 expandAction="click" 和 motion 同時啟用時,追蹤受控展開路徑,尤其是在點擊葉節點之後。完成的標準是:無需外部重新渲染,節點仍然可以展開和摺疊。
由索引模型根據 Issue 內容生成。
描述
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.

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:
- Remove
onCheck,checkedKeys,onSelectandselectedKeysprops - Add
expandAction="click" - Add
motion={motion}with some style (from the animation example)
Steps to reproduce:
- Expand all nodes until you come to a leaf
- Click on the leaf title
- Nodes can no longer be expanded nor collapsed
rc-tree version: 5.7.0
Thanks for your help!
- 主要語言
- TypeScript
- 星號
- 1.3k
- 分支
- 490
- 平均合併
- 42 分鐘
- 30 天內合併 PR
- 2
環境準備
我們還沒有檢查這個專案的環境設定檔。先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
react-component/tree 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 55/100
react-component/tree#1068 · 1 則留言 ·
-
難度 5/5 一週以上 新手友好度 20/100
react-component/tree#983 ·
-
難度 3/5 1-2 天 新手友好度 35/100
react-component/tree#937 ·
-
難度 5/5 一週以上 新手友好度 25/100
react-component/tree#935 ·
-
難度 3/5 1-2 天 新手友好度 35/100
react-component/tree#929 ·
查看 react-component/tree 的全部 Issue
相似的 Issue
-
難度 1/5 1 小時以內 新手友好度 78/100
lichess-org/api#678 ·
-
難度 2/5 1-3 小時 新手友好度 84/100
PostHog/posthog.com#20628 ·
維護者通常 1 天內回覆
-
bug status:Needs Triage
難度 1/5 1 小時以內 新手友好度 92/100
jupyterlab/jupyterlab#19964 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 78/100
agentscope-ai/QwenPaw#8064 · 1 則留言 ·
維護者通常 1 天內回覆
-
area: notebooks-jupyter bug theme: new notebook frontend
難度 2/5 1-3 小時 新手友好度 88/100
posit-dev/positron#16347 · 1 則留言 ·
維護者通常 1 天內回覆