File tree Expand file tree Collapse file tree 4 files changed +4
-2
lines changed Expand file tree Collapse file tree 4 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
17
17
- Ensure ` appear ` works using the ` Transition ` component (even when used with SSR) ([ #2646 ] ( https://github.com/tailwindlabs/headlessui/pull/2646 ) )
18
18
- Improve resetting values when using the ` nullable ` prop on the ` Combobox ` component ([ #2660 ] ( https://github.com/tailwindlabs/headlessui/pull/2660 ) )
19
19
- Fix hydration of components inside ` <Suspense> ` ([ #2663 ] ( https://github.com/tailwindlabs/headlessui/pull/2663 ) )
20
+ - Prevent scrolling when focusing a tab ([ #2674 ] ( https://github.com/tailwindlabs/headlessui/pull/2674 ) )
20
21
21
22
## [ 1.7.16] - 2023-07-27
22
23
Original file line number Diff line number Diff line change @@ -472,7 +472,7 @@ function TabFn<TTag extends ElementType = typeof DEFAULT_TAB_TAG>(
472
472
if ( ready . current ) return
473
473
ready . current = true
474
474
475
- internalTabRef . current ?. focus ( )
475
+ internalTabRef . current ?. focus ( { preventScroll : true } )
476
476
actions . change ( myIndex )
477
477
478
478
microTask ( ( ) => {
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
17
17
- Improve SSR of the ` Disclosure ` component ([ #2645 ] ( https://github.com/tailwindlabs/headlessui/pull/2645 ) )
18
18
- Fix incorrectly focused ` ComboboxInput ` component on page load ([ #2654 ] ( https://github.com/tailwindlabs/headlessui/pull/2654 ) )
19
19
- Improve resetting values when using the ` nullable ` prop on the ` Combobox ` component ([ #2660 ] ( https://github.com/tailwindlabs/headlessui/pull/2660 ) )
20
+ - Prevent scrolling when focusing a tab ([ #2674 ] ( https://github.com/tailwindlabs/headlessui/pull/2674 ) )
20
21
21
22
## [ 1.7.15] - 2023-07-27
22
23
Original file line number Diff line number Diff line change @@ -405,7 +405,7 @@ export let Tab = defineComponent({
405
405
406
406
if ( props . disabled ) return
407
407
408
- dom ( internalTabRef ) ?. focus ( )
408
+ dom ( internalTabRef ) ?. focus ( { preventScroll : true } )
409
409
api . setSelectedIndex ( myIndex . value )
410
410
411
411
microTask ( ( ) => {
You can’t perform that action at this time.
0 commit comments