File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -113,25 +113,25 @@ function getLastElement() {
113113}
114114
115115function isIgnoredElement ( element : Element | null ) : boolean {
116- if ( ! element ) return false ;
117116 const lastElement = getLastElement ( ) ;
118- if ( ! lastElement ) return false ;
119-
120- // Find the ID that maps to the last element
121- let lockId : string | undefined ;
122- for ( const [ id , ele ] of idToElementMap . entries ( ) ) {
123- if ( ele === lastElement ) {
124- lockId = id ;
125- break ;
117+
118+ if ( element && lastElement ) {
119+ // Find the ID that maps to the last element
120+ let lockId : string | undefined ;
121+ for ( const [ id , ele ] of idToElementMap . entries ( ) ) {
122+ if ( ele === lastElement ) {
123+ lockId = id ;
124+ break ;
125+ }
126126 }
127- }
128127
129- if ( ! lockId ) return false ;
128+ const ignoredEle = ignoredElementMap . get ( lockId ) ;
129+ return (
130+ ! ! ignoredEle && ( ignoredEle === element || ignoredEle . contains ( element ) )
131+ ) ;
132+ }
130133
131- const ignoredEle = ignoredElementMap . get ( lockId ) ;
132- return (
133- ! ! ignoredEle && ( ignoredEle === element || ignoredEle . contains ( element ) )
134- ) ;
134+ return false ;
135135}
136136
137137function hasFocus ( element : HTMLElement ) {
You can’t perform that action at this time.
0 commit comments