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

Canvas overlay doesn't update after resize #2865

Closed
2 tasks done
Janpot opened this issue Nov 3, 2023 · 2 comments · Fixed by #3044
Closed
2 tasks done

Canvas overlay doesn't update after resize #2865

Janpot opened this issue Nov 3, 2023 · 2 comments · Fixed by #3044
Labels
bug 🐛 Something doesn't work feature: App Editor good first issue Great for first contributions. Enable to learn the contribution process. regression A bug, but worse scope: toolpad-studio Abbreviated to "studio"

Comments

@Janpot
Copy link
Member

Janpot commented Nov 3, 2023

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 🕹

Steps:

  1. select an element in the canvas
  2. resize the canvas

Current behavior 😯

Screen.Recording.2023-11-03.at.18.32.39.mov

The canvas overlay doesn't update

Expected behavior 🤔

It should update the size of the node hud.

Context 🔦

No response

Your environment 🌎

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.
@Janpot Janpot added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Nov 3, 2023
@Janpot
Copy link
Member Author

Janpot commented Nov 3, 2023

I bissected the commits on master and the issue seems to have been introduced in #2760

A quick test suggests the following could solve the issue

diff --git a/packages/toolpad-app/src/canvas/index.tsx b/packages/toolpad-app/src/canvas/index.tsx
index 7763af531..d3c43bb1b 100644
--- a/packages/toolpad-app/src/canvas/index.tsx
+++ b/packages/toolpad-app/src/canvas/index.tsx
@@ -65,14 +65,6 @@ export default function AppCanvas({
     };
   }, []);
 
-  React.useEffect(
-    () => () => {
-      appRootCleanupRef.current?.();
-      appRootCleanupRef.current = undefined;
-    },
-    [],
-  );
-
   // Notify host after every render
   React.useEffect(() => {
     if (appRootRef.current) {

@Janpot Janpot added regression A bug, but worse good first issue Great for first contributions. Enable to learn the contribution process. and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Nov 3, 2023
@apedroferreira
Copy link
Member

I had a fix here #2818, but I guess your suggestion is probably better, I hadn't realized this was a recent regression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work feature: App Editor good first issue Great for first contributions. Enable to learn the contribution process. regression A bug, but worse scope: toolpad-studio Abbreviated to "studio"
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants