Skip to content

Commit

Permalink
Focus when selecting
Browse files Browse the repository at this point in the history
  • Loading branch information
jameskerr committed Apr 2, 2024
1 parent 6cd3cb6 commit f034806
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/react-arborist/src/controllers/tree-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,12 @@ export class TreeController<T> {

select(id: string) {
this.props.selection.onChange({ type: "select", id });
this.focus(id);
}

selectMulti(id: string) {
this.props.selection.onChange({ type: "select-multi", id });
this.focus(id);
}

selectContiguous(id: string) {
Expand All @@ -211,6 +213,7 @@ export class TreeController<T> {
id,
tree: this,
});
this.focus(id);
}

selectAll() {
Expand All @@ -222,6 +225,7 @@ export class TreeController<T> {

deselect(id: string) {
this.props.selection.onChange({ type: "deselect", id });
this.focus(id);
}

/* Drag and Drop State */
Expand Down

0 comments on commit f034806

Please sign in to comment.