mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-15 17:12:59 -04:00
scroll fixing
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -11,7 +11,7 @@
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
||||
<meta name="apple-mobile-web-app-title" content="Roomba Rover" />
|
||||
<title>Roomba Rover</title>
|
||||
<script type="module" crossorigin src="/assets/index-B2-u-cpw.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-Cn5NPWDD.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-LJWnKvT4.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -103,9 +103,11 @@ export default function HornControl({
|
||||
const handleFreqWheel = useCallback(
|
||||
(index) => (event) => {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
const direction = event.deltaY < 0 ? 1 : -1;
|
||||
const step = 25;
|
||||
const current = Number(freqs[index]) || 0;
|
||||
updateFreq(index, current + direction);
|
||||
updateFreq(index, current + direction * step);
|
||||
},
|
||||
[freqs, updateFreq],
|
||||
);
|
||||
@@ -210,6 +212,7 @@ export default function HornControl({
|
||||
step={1}
|
||||
value={freq}
|
||||
onChange={(event) => updateFreq(idx, event.target.value)}
|
||||
onWheelCapture={handleFreqWheel(idx)}
|
||||
onWheel={handleFreqWheel(idx)}
|
||||
className="w-full rounded border border-slate-700 bg-slate-900 px-1 py-[2px] text-right text-[0.65rem] font-mono text-slate-100"
|
||||
/>
|
||||
@@ -240,6 +243,7 @@ export default function HornControl({
|
||||
step={1}
|
||||
value={freq}
|
||||
onChange={(event) => updateFreq(idx, event.target.value)}
|
||||
onWheelCapture={handleFreqWheel(idx)}
|
||||
onWheel={handleFreqWheel(idx)}
|
||||
className="w-full rounded border border-slate-700 bg-slate-900 px-1 py-[2px] text-right text-[0.65rem] font-mono text-slate-100"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user