Do not reset active item, if mouse simply moved

オープン
#689 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
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 を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

react-component/tree のほかの issue

react-component/tree の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。