File tree 2 files changed +17
-31
lines changed
@headlessui-react/src/components/combobox
@headlessui-vue/src/components/combobox
2 files changed +17
-31
lines changed Original file line number Diff line number Diff line change @@ -532,21 +532,14 @@ function VirtualProvider(props: {
532
532
return
533
533
}
534
534
535
- // Scroll to the active index
536
- {
537
- // Ignore this when we are in a test environment
538
- if ( typeof process !== 'undefined' && process . env . JEST_WORKER_ID !== undefined ) {
539
- return
540
- }
541
-
542
- // Do not scroll when the mouse/pointer is being used
543
- if ( data . activationTrigger === ActivationTrigger . Pointer ) {
544
- return
545
- }
535
+ // Do not scroll when the mouse/pointer is being used
536
+ if ( data . activationTrigger === ActivationTrigger . Pointer ) {
537
+ return
538
+ }
546
539
547
- if ( data . activeOptionIndex !== null && options . length > data . activeOptionIndex ) {
548
- virtualizer . scrollToIndex ( data . activeOptionIndex )
549
- }
540
+ // Scroll to the active index
541
+ if ( data . activeOptionIndex !== null && options . length > data . activeOptionIndex ) {
542
+ virtualizer . scrollToIndex ( data . activeOptionIndex )
550
543
}
551
544
} }
552
545
>
Original file line number Diff line number Diff line change @@ -190,24 +190,17 @@ let VirtualProvider = defineComponent({
190
190
return
191
191
}
192
192
193
- // Scroll to the active index
194
- {
195
- // Ignore this when we are in a test environment
196
- if ( typeof process !== 'undefined' && process . env . JEST_WORKER_ID !== undefined ) {
197
- return
198
- }
199
-
200
- // Do not scroll when the mouse/pointer is being used
201
- if ( api . activationTrigger . value === ActivationTrigger . Pointer ) {
202
- return
203
- }
193
+ // Do not scroll when the mouse/pointer is being used
194
+ if ( api . activationTrigger . value === ActivationTrigger . Pointer ) {
195
+ return
196
+ }
204
197
205
- if (
206
- api . activeOptionIndex . value !== null &&
207
- api . virtual . value ! . options . length > api . activeOptionIndex . value
208
- ) {
209
- virtualizer . value . scrollToIndex ( api . activeOptionIndex . value )
210
- }
198
+ // Scroll to the active index
199
+ if (
200
+ api . activeOptionIndex . value !== null &&
201
+ api . virtual . value ! . options . length > api . activeOptionIndex . value
202
+ ) {
203
+ virtualizer . value . scrollToIndex ( api . activeOptionIndex . value )
211
204
}
212
205
} ,
213
206
} ,
You can’t perform that action at this time.
0 commit comments