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

Never open panes while the StagingView does not have focus #1488

Merged
merged 2 commits into from May 29, 2018

Conversation

Projects
None yet
1 participant
@smashwilson
Member

smashwilson commented May 29, 2018

The root cause of #1287 and #1444 is that FilePatch items are launched from a didSelectSingleItem() function that's triggered from a componentDidUpdate() lifecycle method when the selection model has changed. componentDidUpdate() is called when you click on an item or navigate with the keyboard because both actions call setState() with a modified selection model, but it's also called when the component is re-rendered with changed props, and any time that this occurs with a referentially unequal selection model, the patch is shown.

Previously (#1472), I was trying to track down the causes of a component update being triggered with a referentially unequal selection model that weren't due to an explicit user interaction. That's tricky, though, and I'd never know if I actually caught them all. Now I'm taking a different tack and simply short-circuiting pane creation if the StagingView doesn't have focus. Let's see if this is more reliable.

smashwilson added some commits May 29, 2018

@smashwilson smashwilson merged commit b337cc8 into master May 29, 2018

3 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@smashwilson smashwilson deleted the aw/arg-stop-it-bad-computer branch May 29, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment