-
Notifications
You must be signed in to change notification settings - Fork 37
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
STCOM-1386 Paneset: check for existing id before registering pane #2395
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your description of the symptom sounds correct. Bravo! I have seen this and been totally mystified by it.
Are you confident this the Most Correct fix? I worry a little bit that we are treating the symptom here (double registration) instead of a root problem (missing cleanup function).
The anointed React best-practice tenant is applicable here - |
|
) Panes can exhibit strange behavior in the dev environment that just doesn't happen in production. I believe this is caused by pane registration misbehaving in React StrictMode (where mounting happens twice). This PR dedupes the panes by checking if a pane id already exists in the paneset - and if it does, the pane is not added. Problematic behavior can be seen specifically with panes that have `defaultWidth: "fill"` - they'll be registered twice, and their width calculation (which divides the remaining width among other `fill` panes) will leave them being half the size they should be. Hiding a search/filter pane can leave the results view at only 50% of its width, when it should be the full width of the view when it's the only pane.
Panes can exhibit strange behavior in the dev environment that just doesn't happen in production. I believe this is caused by pane registration misbehaving in React StrictMode (where mounting happens twice). This PR dedupes the panes by checking if a pane id already exists in the paneset - and if it does, the pane is not added.
Problematic behavior can be seen specifically with panes that have
defaultWidth: "fill"
- they'll be registered twice, and their width calculation (which divides the remaining width among otherfill
panes) will leave them being half the size they should be. Hiding a search/filter pane can leave the results view at only 50% of its width, when it should be the full width of the view when it's the only pane.