File tree Expand file tree Collapse file tree 1 file changed +1
-12
lines changed
Expand file tree Collapse file tree 1 file changed +1
-12
lines changed Original file line number Diff line number Diff line change @@ -56,18 +56,7 @@ export function useResultsKeyboardNavigation(options?: {
5656 */
5757 function focusElement ( el : HTMLElement ) {
5858 el . focus ( { preventScroll : true } )
59-
60- // Only scroll if element is not already in viewport
61- const rect = el . getBoundingClientRect ( )
62- const isInViewport =
63- rect . top >= 0 &&
64- rect . left >= 0 &&
65- rect . bottom <= ( window . innerHeight || document . documentElement . clientHeight ) &&
66- rect . right <= ( window . innerWidth || document . documentElement . clientWidth )
67-
68- if ( ! isInViewport ) {
69- el . scrollIntoView ( { block : 'nearest' , behavior : 'smooth' } )
70- }
59+ el . scrollIntoView ( { block : 'nearest' , behavior : 'smooth' } )
7160 }
7261
7362 function handleKeydown ( e : KeyboardEvent ) {
You can’t perform that action at this time.
0 commit comments