File tree Expand file tree Collapse file tree 4 files changed +10
-3
lines changed
packages/@headlessui-react/src/components Expand file tree Collapse file tree 4 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
15
15
- Improve overal codebase, use modern tech like ` esbuild ` and TypeScript 4! ([ #1055 ] ( https://github.com/tailwindlabs/headlessui/pull/1055 ) )
16
16
- Improve build files ([ #1078 ] ( https://github.com/tailwindlabs/headlessui/pull/1078 ) )
17
17
- Ensure typeahead stays on same item if it still matches ([ #1098 ] ( https://github.com/tailwindlabs/headlessui/pull/1098 ) )
18
+ - Fix off-by-one frame issue causing flicker ([ #1111 ] ( https://github.com/tailwindlabs/headlessui/pull/1111 ) )
18
19
19
20
### Added
20
21
Original file line number Diff line number Diff line change @@ -856,7 +856,9 @@ function Option<
856
856
if ( state . comboboxState !== ComboboxStates . Open ) return
857
857
if ( ! active ) return
858
858
let d = disposables ( )
859
- d . nextFrame ( ( ) => document . getElementById ( id ) ?. scrollIntoView ?.( { block : 'nearest' } ) )
859
+ d . requestAnimationFrame ( ( ) => {
860
+ document . getElementById ( id ) ?. scrollIntoView ?.( { block : 'nearest' } )
861
+ } )
860
862
return d . dispose
861
863
} , [ id , active , state . comboboxState ] )
862
864
Original file line number Diff line number Diff line change @@ -666,7 +666,9 @@ function Option<
666
666
if ( state . listboxState !== ListboxStates . Open ) return
667
667
if ( ! active ) return
668
668
let d = disposables ( )
669
- d . nextFrame ( ( ) => document . getElementById ( id ) ?. scrollIntoView ?.( { block : 'nearest' } ) )
669
+ d . requestAnimationFrame ( ( ) => {
670
+ document . getElementById ( id ) ?. scrollIntoView ?.( { block : 'nearest' } )
671
+ } )
670
672
return d . dispose
671
673
} , [ id , active , state . listboxState ] )
672
674
Original file line number Diff line number Diff line change @@ -535,7 +535,9 @@ function Item<TTag extends ElementType = typeof DEFAULT_ITEM_TAG>(
535
535
if ( state . menuState !== MenuStates . Open ) return
536
536
if ( ! active ) return
537
537
let d = disposables ( )
538
- d . nextFrame ( ( ) => document . getElementById ( id ) ?. scrollIntoView ?.( { block : 'nearest' } ) )
538
+ d . requestAnimationFrame ( ( ) => {
539
+ document . getElementById ( id ) ?. scrollIntoView ?.( { block : 'nearest' } )
540
+ } )
539
541
return d . dispose
540
542
} , [ id , active , state . menuState ] )
541
543
You can’t perform that action at this time.
0 commit comments