Mapbox-gl-js: Hash replacing whole path

Created on 26 Aug 2020  路  2Comments  路  Source: mapbox/mapbox-gl-js

1.12.0:

cross-browser:

Steps to Trigger Behavior

  1. Instantiate the Map with 'hash' option !== false.
  2. Serve the code on a non-root url path. eg www.iamaurl.com/non-root-url-path.
  3. Visit the url you're hosting the code on (www.iamaurl.com/non-root-url-path).
  4. Take a very thorough look at your url address bar.
  5. Ask yourself whose brilliant idea was it to ignore current url when replacing history.

I'm posting this as a bug because this behaviour renders this whole feature completely useless for any non-trivial example (using a router of any sorts for that matter, which probably includes TODO apps today).

Link to Demonstration

Please.

Expected Behavior

Change hash without overwriting the whole url irreversibly.

Actual Behavior

Overwrites whole url irreversibly.

bug

Most helpful comment

I strongly discourage the the condescending language in this report, we encourage people to be respectful in this community.

Since it seems like you have a brilliant idea with regard to this, PR's are always welcome! I think you'd want to make the change here
https://github.com/mapbox/mapbox-gl-js/blob/53b8a4059a1260b3a48e443a0886cfed3b82c002/src/ui/hash.js#L137

All 2 comments

I strongly discourage the the condescending language in this report, we encourage people to be respectful in this community.

Since it seems like you have a brilliant idea with regard to this, PR's are always welcome! I think you'd want to make the change here
https://github.com/mapbox/mapbox-gl-js/blob/53b8a4059a1260b3a48e443a0886cfed3b82c002/src/ui/hash.js#L137

@arindam1993 damn you for taking the highroad! Alright, apologies in that case, and I'll create a PR for that matter.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yoursweater picture yoursweater  路  3Comments

rasagy picture rasagy  路  3Comments

aderaaij picture aderaaij  路  3Comments

muesliq picture muesliq  路  3Comments

iamdenny picture iamdenny  路  3Comments