-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Make listing details modal close on internally-triggered navigation #14504
Make listing details modal close on internally-triggered navigation #14504
Conversation
* Provide a way to close modal if it's open
Thank you for opening this PR! We appreciate you! For all pull requests coming from third-party forks we will need to A Forem Team member will review this contribution and get back to |
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.
Works perfectly, thank you @fyodorio!
@fyodorio for some reason Travis was stuck, so I added an empty commit to unstuck it :D |
@nickytonline @aitchiss Hey Nick and Suzanne, could you weigh in on the addition of a test for this PR? The contributor had this to say:
|
I think this change would be a great fit for a Cypress integration test - you can check this section in our docs for full details of how we use Cypress & some best practice tips. This could be a new file in the directory
I'm thinking your test could be very similar the one above, but instead of closing the open modal, selecting a link from inside it and then checking the modal is no longer visible. Let me know how you get on and if you have any difficulties 👍 |
@aitchiss thanks for the guidance Suzanne, sounds good, will write the test and update the PR 👌 |
…g-details-modal-on-navigation-14459
@fyodorio thanks again for working on this bug. We are wrapping up the bug smash event and I wanted to encourage you to write a post about your experience if you have time. |
Done, @cmgorton, sorry that it's quite late, busy September 😅 |
What type of PR is this? (check all applicable)
Description
The detailed description is here but in general, when you (1) go to the listings page and (2) open one of the listings by clicking its title, and then (3) try to navigate from it to the specific category this listing belongs to (by clicking category name in the listing modal footer), (4) navigation happens on the background but (5) modal window doesn't close (though it should).
The solution is simple - we can check if a modal is open in
selectCategory()
handler inlistings.jsx
and if it is - close the modal.Ideally it would probably be better to hook up on navigation event inside the Modal component itself, but that's not how it works now everywhere else in the code so I would suggest to stick with this (more specific) solution.
Related Tickets & Documents
CLOSES #14459
QA Instructions, Screenshots, Recordings
Steps to reproduce are described in the issue details 👆
Added/updated tests?
[Forem core team only] How will this change be communicated?
Will this PR introduce a change that impacts Forem members or creators, the
development process, or any of our internal teams? If so, please note how you
will share this change with the people who need to know about it.
Admin Guide, or
Storybook (for Crayons components)
CHANGELOG.md
or in a forem.dev post
replace this line with details on why this change doesn't need to be
shared
[optional] What gif best describes this PR or how it makes you feel?