@@ -147,10 +147,10 @@ function createFocusManagerForScope(scopeRef: React.RefObject<HTMLElement[]>): F
147
147
return {
148
148
focusNext ( opts : FocusManagerOptions = { } ) {
149
149
let scope = scopeRef . current ;
150
- let { from, tabbable, wrap} = opts ;
150
+ let { from, tabbable, wrap, accept } = opts ;
151
151
let node = from || document . activeElement ;
152
152
let sentinel = scope [ 0 ] . previousElementSibling ;
153
- let walker = getFocusableTreeWalker ( getScopeRoot ( scope ) , { tabbable} , scope ) ;
153
+ let walker = getFocusableTreeWalker ( getScopeRoot ( scope ) , { tabbable, accept } , scope ) ;
154
154
walker . currentNode = isElementInScope ( node , scope ) ? node : sentinel ;
155
155
let nextNode = walker . nextNode ( ) as HTMLElement ;
156
156
if ( ! nextNode && wrap ) {
@@ -164,10 +164,10 @@ function createFocusManagerForScope(scopeRef: React.RefObject<HTMLElement[]>): F
164
164
} ,
165
165
focusPrevious ( opts : FocusManagerOptions = { } ) {
166
166
let scope = scopeRef . current ;
167
- let { from, tabbable, wrap} = opts ;
167
+ let { from, tabbable, wrap, accept } = opts ;
168
168
let node = from || document . activeElement ;
169
169
let sentinel = scope [ scope . length - 1 ] . nextElementSibling ;
170
- let walker = getFocusableTreeWalker ( getScopeRoot ( scope ) , { tabbable} , scope ) ;
170
+ let walker = getFocusableTreeWalker ( getScopeRoot ( scope ) , { tabbable, accept } , scope ) ;
171
171
walker . currentNode = isElementInScope ( node , scope ) ? node : sentinel ;
172
172
let previousNode = walker . previousNode ( ) as HTMLElement ;
173
173
if ( ! previousNode && wrap ) {
@@ -181,8 +181,8 @@ function createFocusManagerForScope(scopeRef: React.RefObject<HTMLElement[]>): F
181
181
} ,
182
182
focusFirst ( opts = { } ) {
183
183
let scope = scopeRef . current ;
184
- let { tabbable} = opts ;
185
- let walker = getFocusableTreeWalker ( getScopeRoot ( scope ) , { tabbable} , scope ) ;
184
+ let { tabbable, accept } = opts ;
185
+ let walker = getFocusableTreeWalker ( getScopeRoot ( scope ) , { tabbable, accept } , scope ) ;
186
186
walker . currentNode = scope [ 0 ] . previousElementSibling ;
187
187
let nextNode = walker . nextNode ( ) as HTMLElement ;
188
188
if ( nextNode ) {
@@ -192,8 +192,8 @@ function createFocusManagerForScope(scopeRef: React.RefObject<HTMLElement[]>): F
192
192
} ,
193
193
focusLast ( opts = { } ) {
194
194
let scope = scopeRef . current ;
195
- let { tabbable} = opts ;
196
- let walker = getFocusableTreeWalker ( getScopeRoot ( scope ) , { tabbable} , scope ) ;
195
+ let { tabbable, accept } = opts ;
196
+ let walker = getFocusableTreeWalker ( getScopeRoot ( scope ) , { tabbable, accept } , scope ) ;
197
197
walker . currentNode = scope [ scope . length - 1 ] . nextElementSibling ;
198
198
let previousNode = walker . previousNode ( ) as HTMLElement ;
199
199
if ( previousNode ) {
0 commit comments