@@ -7,7 +7,7 @@ import 'vs/css!./variablesInstance';
77import * as React from 'react' ;
88import { KeyboardEvent , useEffect , useRef , useState } from 'react' ; // eslint-disable-line no-duplicate-imports
99import * as DOM from 'vs/base/browser/dom' ;
10- import { isMacintosh } from 'vs/base/common/platform' ;
10+ import { isMacintosh , isWeb } from 'vs/base/common/platform' ;
1111import { DisposableStore } from 'vs/base/common/lifecycle' ;
1212import { useStateRef } from 'vs/base/browser/ui/react/useStateRef' ;
1313import { FixedSizeList as List , ListChildComponentProps } from 'react-window' ;
@@ -448,6 +448,15 @@ export const VariablesInstance = (props: VariablesInstanceProps) => {
448448 positronVariablesContext . reactComponentContainer . focusChanged ?.( false ) ;
449449 } ;
450450
451+ // workaround for web disabling scrolling on the window to prevent URL navigation
452+ const wheelHandler = ( e : React . WheelEvent < HTMLDivElement > ) => {
453+ if ( ! isWeb ) {
454+ return ;
455+ }
456+
457+ innerRef . current . parentElement ?. scrollBy ( e . deltaX , e . deltaY ) ;
458+ } ;
459+
451460 /**
452461 * VariableEntry component.
453462 * @param index The index of the variable entry.
@@ -523,6 +532,7 @@ export const VariablesInstance = (props: VariablesInstanceProps) => {
523532 onKeyDown = { keyDownHandler }
524533 onFocus = { focusHandler }
525534 onBlur = { blurHandler }
535+ onWheel = { wheelHandler }
526536 >
527537 { ! variableEntries . length ?
528538 < VariablesEmpty initializing = { initializing } /> :
0 commit comments