Node expansion via drag event misses to async load tree data

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

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
react, typescript
領域
frontend

調査の方向性

src/Tree.tsx の 565 行目付近から開始し、ドラッグによる展開の経路を、onNodeExpand を呼び出すキーボードナビゲーションとマウスクリックの経路と比較します。ドラッグイベントによってノードを展開した場合にも、遅延ロードされた子ノードが取得されることを確認します。ドラッグによる展開後に非同期のツリーデータが読み込まれ、他の展開操作と一致すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Status Quo

The tree component is expanding the tree node, if the user has dragged over the tree node for longer time.
Thus, the tree comonent is expanding this particular tree node, hence tree is showing the children of that tree node, as well.

Problem

The tree component does not ensure that the tree data is fetched, if lazy load is used, once the tree node is expanded via drag enter/over event.

Root cause

It seems only the expanded keys are updated and onExpand is getting called, see:
https://github.com/react-component/tree/blob/22c5ace87f7c27a452b444a63e1a927488525520/src/Tree.tsx#L565

Solution Proposal

The onNodeExpand function should be called in case of expansion via drag event, like it is done for keyboard navigation or mouse-click event, since this ensures the async load.

主要言語
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 を短くまとめたダイジェスト。