This repository was archived by the owner on Apr 18, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +13
-8
lines changed
components/SidePanels/OutlinerPanel Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -173,19 +173,23 @@ const useEventHandlers = ({
173173 const multi = evt . nativeEvent . ctrlKey || ( isMacOS ( ) && evt . nativeEvent . metaKey ) ;
174174 const { node } = evt ;
175175
176- const self = node . item ;
176+ const self = node ?. item ;
177+
178+ if ( ! self ?. annotation ) return ;
179+
177180 const annotation = self . annotation ;
178181
179182 if ( multi ) {
180183 annotation . toggleRegionSelection ( self ) ;
181- } else {
182- const wasNotSelected = ! self . selected ;
184+ return ;
185+ }
186+
187+ const wasNotSelected = ! self . selected ;
183188
184- if ( wasNotSelected ) {
185- annotation . selectArea ( self ) ;
186- } else {
187- annotation . unselectAll ( ) ;
188- }
189+ if ( wasNotSelected ) {
190+ annotation . selectArea ( self ) ;
191+ } else {
192+ annotation . unselectAll ( ) ;
189193 }
190194 } , [ ] ) ;
191195
Original file line number Diff line number Diff line change @@ -108,6 +108,7 @@ const SelectionMap = types.model(
108108 highlight ( region ) {
109109 self . clear ( ) ;
110110 self . select ( region ) ;
111+ region ?. shapeRef ?. parent ?. canvas ?. _canvas ?. scrollIntoView ?. ( ) ;
111112 } ,
112113 } ;
113114} ) ;
You can’t perform that action at this time.
0 commit comments