Skip to content

Commit 7c6249b

Browse files
committed
Fix round off for scrolling
1 parent 08e052b commit 7c6249b

4 files changed

Lines changed: 5 additions & 3 deletions
Loading
Loading
Loading

__tests__/html/transcript.navigation.focusActivity.scrollIntoView.assumptions.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en-US">
33
<head>
44
<link href="/assets/index.css" rel="stylesheet" type="text/css" />
@@ -38,8 +38,10 @@
3838

3939
const clientTopToScrollable = input.getClientRects()[0].y - transcriptScrollable.getClientRects()[0].y;
4040

41-
transcriptScrollable.scrollTop -=
42-
transcriptScrollable.offsetHeight - clientTopToScrollable - input.offsetHeight / 2;
41+
transcriptScrollable.scrollTop = ~~(
42+
transcriptScrollable.scrollTop -
43+
(transcriptScrollable.offsetHeight - clientTopToScrollable - input.offsetHeight / 2)
44+
);
4345

4446
const { scrollTop } = transcriptScrollable;
4547

0 commit comments

Comments
 (0)