Skip to content

Commit cc21402

Browse files
authored
Merge pull request #135 from brunomikoski/fix/browser_selection
fix: handle keyboard selection
2 parents e7edb4d + 0cf78ca commit cc21402

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

CHANGELOG.MD

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [2.2.1]
10+
### Fixed
11+
- Update active editor when selecting a new item with the keyboard
12+
913

1014
## [2.2.0]
1115
### Added

Scripts/Editor/Browser/BrowserTreeView.cs

+15-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using UnityEditor;
1+
using System.Collections.Generic;
2+
using UnityEditor;
23
using UnityEditor.IMGUI.Controls;
34
using UnityEngine;
45

@@ -30,7 +31,6 @@ public BrowserTreeView(TreeViewState state, MultiColumnHeader multiColumnHeader)
3031
private void Initialize()
3132
{
3233
showAlternatingRowBackgrounds = true;
33-
// showBorder = true;
3434
Reload();
3535
}
3636

@@ -71,6 +71,19 @@ protected override bool CanMultiSelect(TreeViewItem item)
7171
return false;
7272
}
7373

74+
protected override void SelectionChanged(IList<int> selectedIds)
75+
{
76+
if (selectedIds.Count != 1)
77+
return;
78+
79+
TreeViewItem item = FindItem(selectedIds[0], rootItem);
80+
81+
if (item is BrowserTreeViewItem treeViewItem)
82+
{
83+
ItemClicked?.Invoke(treeViewItem);
84+
}
85+
}
86+
7487
protected override void SingleClickedItem(int id)
7588
{
7689
TreeViewItem item = FindItem(id, rootItem);

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "com.brunomikoski.scriptableobjectcollection",
33
"displayName": "Scriptable Object Collection",
4-
"version": "2.2.0",
4+
"version": "2.2.1",
55
"unity": "2021.2",
66
"description": "A library to help improve the usability of Unity3D Scriptable Objects by grouping them into a collection and exposing them by code or nice inspectors!",
77
"keywords": [

0 commit comments

Comments
 (0)