react-component / react-component/tree
Is there a way to programmatically focus tree / node?
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.3k
- Forks
- 490
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 5
Description
I was able to achieve this by:
function Tree () {
const rcTree = useRef()
useEffect(() => {
document.querySelector('.rc-tree input').focus()
const state = rcTree.current.state
state.activeKey = focusedId
rcTree.current.setState(state)
})
return (
<TreeView ref={rcTree} />
)
}
But its a little hacky non-react way.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the TreeView usage and the current focus and active-node behavior described in the issue. Define a supported React-facing way to focus the tree or a node without querying the DOM or mutating internal state, and document how completion can be verified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- accessibility, frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100