diff --git a/src/Toolbar.tsx b/src/Toolbar.tsx index 3e873bcb9..3a530dc40 100644 --- a/src/Toolbar.tsx +++ b/src/Toolbar.tsx @@ -10,7 +10,7 @@ import { SetHorzVertDistance } from './components/Toolbar/SetHorzVertDistance' import { SetAngleLength } from './components/Toolbar/setAngleLength' import { SetAbsDistance } from './components/Toolbar/SetAbsDistance' import { SetAngleBetween } from './components/Toolbar/SetAngleBetween' -import { Fragment, useEffect } from 'react' +import { Fragment, WheelEvent, useRef } from 'react' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { faSearch, faX } from '@fortawesome/free-solid-svg-icons' import { Popover, Transition } from '@headlessui/react' @@ -62,10 +62,24 @@ export const Toolbar = () => { executeAst: s.executeAst, })) useAppMode() + const toolbarButtonsRef = useRef(null) + + function handleToolbarButtonsWheelEvent(ev: WheelEvent) { + const span = toolbarButtonsRef.current + if (!span) { + return + } + + span.scrollLeft = span.scrollLeft += ev.deltaY + } function ToolbarButtons({ className }: React.HTMLAttributes) { return ( - + {guiMode.mode === 'default' && (