fix screen bounds not updating (#2022)

There are a lot of cases (eg when interacting with the ui) where the
editor loses focus. This check was preventing us from updating the
viewport screen bounds when appropriate. This function is throttled and
pretty cheap anyway (if the viewport is equal its a no-op) so let's just
remove the condition

### Change Type

- [x] `patch` — Bug fix
This commit is contained in:
alex 2023-10-05 13:31:36 +01:00 committed by GitHub
parent 647977ceec
commit a9236bcbb0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,9 +8,7 @@ export function useScreenBounds() {
useLayoutEffect(() => { useLayoutEffect(() => {
const updateBounds = throttle( const updateBounds = throttle(
() => { () => {
if (editor.instanceState.isFocused) { editor.updateViewportScreenBounds()
editor.updateViewportScreenBounds()
}
}, },
200, 200,
{ {