Skip to content

Commit b3c2bd1

Browse files
committed
fix(prompter): Broken scroll to top
1 parent 72e536d commit b3c2bd1

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

packages/webui/src/client/ui/Prompter/PrompterView.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,10 @@ export class PrompterViewContent extends React.Component<Translated<IProps & ITr
369369
this._lastAnimation = animate(window.scrollY, scrollToPosition, {
370370
duration: 0.4,
371371
ease: 'easeOut',
372-
onUpdate: (latest: number) => window.scrollTo(0, latest),
372+
onUpdate: (latest: number) => window.scrollTo({
373+
top: latest,
374+
behavior: 'instant',
375+
}),
373376
})
374377
}
375378
listAnchorPositions(startY: number, endY: number, sortDirection = 1): [number, Element][] {

packages/webui/src/client/ui/Prompter/controller/joycon-device.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export class JoyConController extends ControllerAbstract {
126126
break
127127
case '2':
128128
// go to top
129-
window.scrollTo(0, 0)
129+
window.scrollTo({ top: 0, behavior: 'instant' })
130130
break
131131
case '3':
132132
// go to following
@@ -152,7 +152,7 @@ export class JoyConController extends ControllerAbstract {
152152
break
153153
case '1':
154154
// go to top
155-
window.scrollTo(0, 0)
155+
window.scrollTo({ top: 0, behavior: 'instant' })
156156
break
157157
case '0':
158158
// go to following
@@ -183,7 +183,7 @@ export class JoyConController extends ControllerAbstract {
183183
case '12':
184184
case '3':
185185
// go to top
186-
window.scrollTo(0, 0)
186+
window.scrollTo({ top: 0, behavior: 'instant' })
187187
break
188188
case '15':
189189
case '1':

packages/webui/src/client/ui/Prompter/controller/shuttle-keyboard-device.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export class ShuttleKeyboardController extends ControllerAbstract {
117117
// jump to top
118118
this.lastSpeed = 0
119119
this.lastSpeedMapPosition = ShuttleKeyboardController.SPEEDMAPNEUTRALPOSITION
120-
window.scrollTo(0, 0)
120+
window.scrollTo({ top: 0, behavior: 'instant' })
121121
return
122122
case 'F11':
123123
// jump to live

0 commit comments

Comments
 (0)