slovnicki / beamer

A routing package built on top of Router and Navigator's pages API, supporting arbitrary nested navigation, guards and more.
MIT License
591 stars 129 forks source link

Beamer seems to drop/ignore hash or pound signs in urls #579

Open point-source opened 2 years ago

point-source commented 2 years ago

Describe the bug A clear and concise description of what the bug is.

Beamer version: 1.5.3

To Reproduce Steps to reproduce the behavior:

  1. Use beamer
  2. Navigate to a url such as /home/page#section
  3. Observe that the BeamState passed to your buildPages method contains no information about the "#section" portion of the url

Expected behavior Include this url information so that the app can act on it

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context This is being used in the context of a deep link. I click an email verification link that directs to a hosted server. The server returns a redirect url which deep links into the app. This url includes a hash sign with critical data after it. I do not have control over the way the server generates the redirect so I cannot remove this symbol.

rdinkel commented 2 years ago

+1 I also see a requirement to use something like "/home/page#section" to be able to go to the page and move/scroll the to the desired location. like the n-th entry in a list.

As a workaround you can do the following: When you are in a route like "/page". Check besides query parameters the Uri.base for %23 (='#') substring and use second half for routing to the desired section.

Update: After trying around I don't see an easy workaround. Since I just started using Beamer I would really appreciate the devs to implement this feature properly. Because it would take me way to long for a proper PR.

TheMaverickProgrammer commented 1 month ago

This is still happening in beamer 1.7.0. We ended up going with another solution.