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

onDidLayoutChange callback catches panels init #597

Closed
artaommahe opened this issue May 3, 2024 · 1 comment
Closed

onDidLayoutChange callback catches panels init #597

artaommahe opened this issue May 3, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@artaommahe
Copy link

Describe the bug

onDidLayoutChange callback is triggered after panels were initialised inside onReady callback despite callback being registered after adding panels.

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://stackblitz.com/edit/vitejs-vite-6lyqey?file=src%2FApp.tsx
  2. See triggered onDidLayoutChange in the console

Expected behavior

onDidLayoutChange should be triggered only on following layout changes

Screenshots

-

Desktop (please complete the following information):

  • Browser Chrome on Mac
  • Version 124.0.6367.119

Additional context

As i see in debugger layout changes are fired through Emitter that triggers callbacks inside a setTimeout, looks like that's the reason why a onDidLayoutChange callback registered after adding panels catches those changes as a layout change.

We're implementing saving the layout to the database and for now have to bypass this behaviour with wrapping onDidLayoutChange listener with a setTimeout that doesn't look stable and relies on Emitter's behaviour.

@mathuo mathuo added the bug Something isn't working label May 3, 2024
@mathuo
Copy link
Owner

mathuo commented May 5, 2024

Thanks for the details description and analysis of the source code.

I have now made the required changes for this to work correctly and it is released in 1.13.1

@mathuo mathuo closed this as completed May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants