Skip to content

fix drawer sticking #1874

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

Closed
wants to merge 1 commit into from
Closed

Conversation

ChristopherChudzicki
Copy link
Contributor

What are the relevant tickets?

Fixes https://github.com/mitodl/hq/issues/6150

Description (What does it do?)

Fixes a bug where the drawer was sticking sometimes—getting stuck in an openable state.

How can this be tested?

  1. On main homepage: Click a card to open the drawer, then click outside the drawer to close it, and quickly click a different card.
    • you'll be stuck in a state where ?resource=1234 is in the URL, but drawer is not open.
  2. Try on this branch. Drawer will not stick.

@ChristopherChudzicki ChristopherChudzicki marked this pull request as ready for review December 4, 2024 19:43
@ChristopherChudzicki ChristopherChudzicki added the Needs Review An open Pull Request that is ready for review label Dec 4, 2024
Comment on lines -97 to -98
onTransitionExited={removeUrlParams}
onClose={setOpen.off}
Copy link
Contributor Author

@ChristopherChudzicki ChristopherChudzicki Dec 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In old version, sometimes onTransitionExited was not firing, which meant that the query param never got removed from the URL. Consequently, the effect with dependencies [requiredArePresent, setOpen, requiredParams] would stop firing, and drawer would stay stuck closed.

@abeglova abeglova self-assigned this Dec 5, 2024
Copy link
Contributor

@abeglova abeglova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order to reproduce the original problem I had to use throttling to simulate a slow network and I got sticking only if i closed out before the drawer was loaded.
With your pr I can't close the window at all until it fully loads

@ChristopherChudzicki
Copy link
Contributor Author

I'm going to close this for now. I'm fairly sure that #1872 is going to resolve the original issue.

@rhysyngsun rhysyngsun deleted the cc/drawer-sticking-fix branch February 7, 2025 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review An open Pull Request that is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants