From 1a8943e9037f9deea352b1d8aa995645d0aa1434 Mon Sep 17 00:00:00 2001 From: Michel Weststrate Date: Thu, 29 Apr 2021 11:44:24 -0700 Subject: [PATCH] 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 --- desktop/flipper-plugin/src/ui/data-table/DataSourceRenderer.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop/flipper-plugin/src/ui/data-table/DataSourceRenderer.tsx b/desktop/flipper-plugin/src/ui/data-table/DataSourceRenderer.tsx index f1dc1aa82..23ed9b539 100644 --- a/desktop/flipper-plugin/src/ui/data-table/DataSourceRenderer.tsx +++ b/desktop/flipper-plugin/src/ui/data-table/DataSourceRenderer.tsx @@ -232,7 +232,7 @@ export const DataSourceRenderer: ( 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);