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

Double tap needed to open some trailheads #147

Open
anselmbradford opened this issue May 29, 2014 · 3 comments
Open

Double tap needed to open some trailheads #147

anselmbradford opened this issue May 29, 2014 · 3 comments

Comments

@anselmbradford
Copy link
Member

Steps to repeat issue:

  • Open the app
  • Click a trailhead marker
  • Close the trail detail view
  • Click another trailhead marker. Two taps are required to select the second trailhead
@anselmbradford
Copy link
Member Author

What I've discovered for this issue:

On first click of the marker, the dispatchEvent code in https://github.com/codeforamerica/trails-mobile/blob/master/www/js/lib/leaflet/leaflet.js (search for "dispatchEvent" as the code is minified) returns false on the first click, and true on the second click. For this method, MDN says:

The return value is false if at least one of the event handlers which handled this event called preventDefault. Otherwise it returns true.

Other than the false/true value different all other variables surrounding the first and second click appear the same.

When the trail detail view is closed with (https://github.com/codeforamerica/trails-mobile/blob/master/www/js/application/controllers.js#L214), only one click is required. However, when closed using the (X) in the upper-right of the trail detail view (https://github.com/codeforamerica/trails-mobile/blob/master/www/js/application/controllers.js#L592), two clicks are required. Possibly the map needs an initial click to give it focus? However, I experimented with Map.focus() in closeTrailView() to no avail.

Additionally, when the the close button (https://github.com/codeforamerica/trails-mobile/blob/master/www/index.html#L134) is refactored to not call closeTrailView() directly and https://github.com/codeforamerica/trails-mobile/blob/master/www/js/application/controllers.js#L592 is set to the exact same $apply code a click on the map uses (https://github.com/codeforamerica/trails-mobile/blob/master/www/js/application/controllers.js#L214-L216) two clicks are still required.

@anselmbradford
Copy link
Member Author

First click event profile:
kvzltzd

Second click event profile:
cniwgam

Note that second click is a single click, but registers two click events. The first click is a single click as well, but only registers one click, because that click has dispatchEvent returning false.

@alanjosephwilliams
Copy link
Member

I've assigned fixing this bug to the v1 release. I'm afraid it may be out of scope given the turnaround we are seeking though.

@anselmbradford anselmbradford removed their assignment Aug 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants