alibaba / alibaba/structure-view

Click Tree view, scroll the selected item to the middle of the view

Open
#24 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
35
Forks
12
PR merge metrics
No merged PRs in 30d

Description

I noticed when tree view item is clicked, if the item is in the current view, there is no scroll. However, still need to scan the whole view to find the item.
I'd propose to scroll the selected item to middle of the view, unless it's already scrolled down to the bottom.

I guess the code is here: https://github.com/alibaba/structure-view/blob/41474513bd0bbca6c22e891779f0816becae4715/lib/util.js#L18

Contributor guide

No contributing guide indexed for this repository

Research direction

Open lib/util.js at the referenced line and trace the tree-item click handling. Reproduce clicking an item that is already visible, then verify it scrolls toward the middle of the view while leaving an item near the bottom from being scrolled past the bottom. Done means the selected item is easier to locate without changing the existing tree selection behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
developer-experience
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.