@@ -138,7 +138,7 @@ const findClickedPattern = (
138138 let best : NestedPath | undefined = undefined
139139
140140 for ( let i = 0 ; i < patterns . length ; i ++ ) {
141- const newBasePattern = combinePatterns ( previousBasePattern , patterns [ i ] )
141+ const newBasePattern = combinePatterns ( previousBasePattern , patterns [ i ] ! )
142142 const newPath = path . concat ( i )
143143
144144 const nestedResult = findClickedPattern ( newBasePattern , patterns , point , newPath )
@@ -170,7 +170,8 @@ export const findClickedScreenOrPattern = (
170170
171171 let best : ClickedPath | undefined = undefined
172172 for ( let i = 0 ; i < screens . length ; i ++ ) {
173- const clickedPath = findClickedPattern ( screens [ i ] , patterns , point )
173+ const screen = screens [ i ] !
174+ const clickedPath = findClickedPattern ( screen , patterns , point )
174175
175176 if ( clickedPath !== undefined ) {
176177 if ( best === undefined || clickedPath . length > best . nestedPath . length ) {
@@ -179,7 +180,7 @@ export const findClickedScreenOrPattern = (
179180 nestedPath : clickedPath ,
180181 }
181182 }
182- } else if ( pointIsInPattern ( point , screens [ i ] ) ) {
183+ } else if ( pointIsInPattern ( point , screen ) ) {
183184 // only check current depth if there's no nested result
184185 if ( best === undefined ) {
185186 best = {
0 commit comments