Do not reset active item, if mouse simply moved
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 45/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- react, typescript
- 領域
- frontend
研究方向
從 src/NodeList.tsx 的第 360-362 行開始,並使用連結的 CodeSandbox 範例重現此行為。追蹤滑鼠移動何時會重設作用中項目,並將其與使用滑鼠選取項目的情況進行比較;當選取的項目保持作用中,同時使用者仍能繼續使用鍵盤導覽時,即表示完成。
由索引模型根據 Issue 內容生成。
描述
Status Quo
Using the keyboard navigation, the tree shows an active active item.
Problem
If the user moves the mouse cursor, the active item is reset.
https://github.com/react-component/tree/blob/62e0bf0b91d86b6e42fee69870ada9a4640b6c6f/src/NodeList.tsx#L360-L362
Use Case
User can select a tree item with mouse cursor, and from there on, continue to use the keyboard navigation.
Please see a sample implementation:
https://codesandbox.io/s/basic-antd-5-0-7-forked-b0nu42?file=/demo.tsx
Hint
Unfortunately, I have to set the focus by hack, to activate the keyboard navigation.
It would be awesome, if tree component supports a interface property, like "focusOnClick".
IMHO, the tree could be focused by default, when clicked. (But not sure about other user's use-cases)
- 主要語言
- TypeScript
- 星號
- 1.3k
- 分支
- 494
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
react-component/tree 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 48/100
react-component/tree#1080 ·
-
Tree crashes on mount with `Cannot read properties of null (reading 'scrollTo')` when a node title contains an autoFocus input可能已有人在做 @hippee-lee 於 118 天前認領。 未關閉
難度 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 ·
查看 react-component/tree 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 68/100
tashfeenahmed/freellmapi#2305 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 82/100
prime-radiant-inc/evener#8335 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
vercel-labs/ui#1921 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
難度 1/5 1-3 小時 新手友好度 65/100
microsoft/monaco-editor#5626 ·
維護者通常 1 天內回覆