[openstreetmap/openstreetmap-website] Clear endpoint values when leaving directions page (PR #5101)
Anton Khorev
notifications at github.com
Wed Aug 21 09:05:01 UTC 2024
Originally was in #5064 but I took it out because it solves a different problem.
The problem is:
1. right-click somewhere on the map, select "Directions from here": a starting marker appears on the map
2. right-click some other place, select "Directions to here": first, another marker appears, then a route
3. close the directions form so you're no longer on the directions page but don't do a full page reload

4. scroll to a different place on the map
5. right-click and select "Directions from here"
What do you expect to happen after step 5? Probably the same thing that happened after step 1: a starting marker appearing. But that's not what's going to happen. A route is going to be built from your new start to an old destination you picked in step 2. This will likely be accompanied by an annoying zoom-out to fit the route if you scrolled far away in step 4.
This PR clears endpoint values when leaving the directions page. This prevents building a route to an old endpoint in step 5.
You can view, comment on, or merge this pull request online at:
https://github.com/openstreetmap/openstreetmap-website/pull/5101
-- Commit Summary --
* Remove endpoint/input values on disable
-- File Changes --
M app/assets/javascripts/index/directions-endpoint.js (3)
-- Patch Links --
https://github.com/openstreetmap/openstreetmap-website/pull/5101.patch
https://github.com/openstreetmap/openstreetmap-website/pull/5101.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5101
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/5101 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240821/0d0d968f/attachment.htm>
More information about the rails-dev
mailing list