Fix autoscroll issue
Summary: Noticed a regression in sticky scrolling not being sticky. I suspect this is caused by pixel inaccuracy + rounding, but our offset from bottom calculation consistently now reports `1` when being at the end of the scrollable region. Too bad it is really hard to protect against these kind of regressions automated. Reviewed By: passy Differential Revision: D28095803 fbshipit-source-id: 1dbd57d84fb308023c2300c543aca344bf27ec28
This commit is contained in:
committed by
Facebook GitHub Bot
parent
65d008c5da
commit
1a8943e903
@@ -232,7 +232,7 @@ export const DataSourceRenderer: <T extends object, C>(
|
||||
return;
|
||||
}
|
||||
const fromEnd = elem.scrollHeight - elem.scrollTop - elem.clientHeight;
|
||||
if (autoScroll && fromEnd >= 1) {
|
||||
if (autoScroll && fromEnd > 1) {
|
||||
onUpdateAutoScroll?.(false);
|
||||
} else if (!autoScroll && fromEnd < 1) {
|
||||
onUpdateAutoScroll?.(true);
|
||||
|
||||
Reference in New Issue
Block a user