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

Panning after opening modal pans map to last location #527

Open
tomporvaz opened this issue Sep 4, 2024 · 4 comments
Open

Panning after opening modal pans map to last location #527

tomporvaz opened this issue Sep 4, 2024 · 4 comments
Assignees
Labels
Bug Something isn't working High Priority Version 2 Features to be developed for Version 2.0 of the PHLASK App

Comments

@tomporvaz
Copy link
Contributor

Describe the bug
In desktop mode (and presumably mobile too) the map will pan to the last location visited specifically after opening the modal and not closing it.

To Reproduce
Steps to reproduce the behavior:

  1. Choose a location (e.g. Franklin Square), click the pin opening the details modal.
  2. Without closing the modal, manually pan the map to another location (e.g. Franklin D. Roosevelt Park).
  3. Click the new location (e.g. Franklin D. Roosevelt Park).
  4. See error, the map has panned back to the first location (e.g. Franklin Square).

Expected behavior
I expect the map to pan to the new location, e.g. Franklin D. Roosevelt Park.

@tomporvaz tomporvaz added Bug Something isn't working Version 2 Features to be developed for Version 2.0 of the PHLASK App labels Sep 4, 2024
@tomporvaz
Copy link
Contributor Author

Also, when modal is opened and then closed, and then near me button is clicked, no pan.
Also, if you open a modal, and then click near me, and then exit modal, the map will pan back to last location.

@ravicodelabs
Copy link
Contributor

Hey. Just started by trying to reproduce the stated issues. There are a few notable points. Here are the findings:

  • Issue 1: Open a location modal, pan to somewhere else (keeping the mentioned modal open), click a new location pin (so that a new modal opens), and the map will incorrectly pan back to the first location.
    • Desktop - Issue not occurring for me in Arc, Chrome, or Safari.
    • Mobile - Not applicable to mobile - can't pan the map while a modal is open.
  • Issue 2 - Near Me not panning to current location after opening/closing a modal.
    • Reproduced issue in Desktop.
    • Reproduced issue in Mobile.
  • Issue 3 - If you open a modal, and then click near me, and then exit the modal, the map will pan back to last location
    • Desktop - Issue seems present, but might be more nuanced. In particular, when location access is not given to the browser, it seems to go back to the last location as previously stated. However, when location access is given to the browser, it is going back to the current location I believe.
    • Mobile - Not applicable - the Near Me button is hidden when modal is open, I think.

Note also that at the moment, I believe current location would be the default current location (around city hall I believe) when location services are off.

@ravicodelabs
Copy link
Contributor

Hi. I'm leaving some of my testing notes here, which organizes the various cases, in case someone else finds it helpful in debugging.

Issue and Environment Location On Location Off Issue Details
Issue A Desktop Issue not occurring in Arc browser. Issue not occurring for me in Arc, Chrome, or Safari. Open a location modal, pan to somewhere else (keeping the mentioned modal open), click a new location pin (so that a new modal opens), and the map will incorrectly pan back to the first location.
Issue A Mobile Not applicable to mobile - can't pan the map while a modal is open. Not applicable to mobile - can't pan the map while a modal is open. Open a location modal, pan to somewhere else (keeping the mentioned modal open), click a new location pin (so that a new modal opens), and the map will incorrectly pan back to the first location.
Issue B Desktop Reproduced issue in Desktop. Reproduced issue in Desktop. Near Me not panning to current location after opening/closing a modal.
Issue B Mobile Reproduced issue in Mobile. Reproduced issue in Mobile. Near Me not panning to current location after opening/closing a modal.
Issue C Desktop Issue also present when location turned on. Also, current location is not showing actual current location, and is instead using the default "La Colombe" default location (e.g. the one used when location is turned off), which also may not be correct. Issue seems present, but might be more nuanced. In particular, when location access is not given to the browser, it seems to go back to the last location as previously stated. However, when location access is given to the browser, it is going back to the current location I believe. If you open a modal, and then click near me, and then exit the modal, the map will pan back to last location
Issue C Mobile Not applicable - the Near Me button is hidden when modal is open, I think. Not applicable - the Near Me button is hidden when modal is open, I think. If you open a modal, and then click near me, and then exit the modal, the map will pan back to last location

ravicodelabs added a commit that referenced this issue Oct 6, 2024
This fixes the issue where opening a site, then clicking "Near Me", then
closing the info modal was panning back to the prior site, whereas it
should have stayed at the "Near Me" site. This is "issue C" as discussed
in the comments of GitHub issue #527.
@ravicodelabs ravicodelabs self-assigned this Oct 6, 2024
@ravicodelabs
Copy link
Contributor

Proposed fix for the issues here is provided in PR #539.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working High Priority Version 2 Features to be developed for Version 2.0 of the PHLASK App
Projects
Status: 🔖 Ready
Development

No branches or pull requests

2 participants