feat: enforce constrains on setting constrains

This commit is contained in:
Arnošt Pleskot 2023-07-04 19:01:05 +02:00
parent 485c57fd59
commit f82363aae9
No known key found for this signature in database

View File

@ -7661,8 +7661,11 @@ class App extends React.Component<AppProps, AppState> {
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;
}