From f82363aae9da535e05d2b6cf3f7b7b0d83eff80d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arno=C5=A1t=20Pleskot?= Date: Tue, 4 Jul 2023 19:01:05 +0200 Subject: [PATCH] feat: enforce constrains on setting constrains --- src/components/App.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/App.tsx b/src/components/App.tsx index 993141d21..daebe197c 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -7661,8 +7661,11 @@ class App extends React.Component { height === prevState.height && cursorButton === prevState.cursorButton; - // If the state hasn't changed or the scroll constraints are not defined, return null - if (!scrollConstraints || stateUnchanged) { + // If the state hasn't changed and scrollConstraints didn't just get defined, return null + if ( + !scrollConstraints || + (stateUnchanged && (prevState.scrollConstraints || !scrollConstraints)) + ) { return null; }