Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Site Editor: Resizable editor canvas should take window resizes into account #52582

Closed
mirka opened this issue Jul 12, 2023 · 0 comments · Fixed by #52697
Closed

Site Editor: Resizable editor canvas should take window resizes into account #52582

mirka opened this issue Jul 12, 2023 · 0 comments · Fixed by #52697
Assignees
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@mirka
Copy link
Member

mirka commented Jul 12, 2023

Part of the resizable editor canvas code relies on some width calculations that are only done on first render.

useEffect( () => {
const { offsetWidth, offsetHeight } = frameRef.current.resizable;
initialComputedWidthRef.current = offsetWidth;
initialAspectRatioRef.current = offsetWidth / offsetHeight;
}, [] );

This can cause the resizing behavior to be glitchy after a user resizes the browser window. There should be a resize listener in place to recalculate the reference widths.

@mirka mirka added [Type] Bug An existing feature does not function as intended [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") labels Jul 12, 2023
@mirka mirka self-assigned this Jul 17, 2023
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant