Closed biji closed 6 years ago
Eya, thanks for the PR 👍
I'm just not entirely sure what the PR is solving. history.replaceState
documentation states:
The new URL does not need to be absolute; if it's relative, it's resolved relative to the current URL.
This makes the current code valid - it's pushing states like #state=1
and ?state=2
explicitly to preserve all existing higher elements, and they are valid URLs.
I even think the PR would break use cases where the originating page and the table renderer are not on the same URL, as you'd be pushing the data URL onto the history in this case, explicitly breaking the browser history.
In my case url is http://localhost:8000/menu/listing
, but when sorting columns url become: http://localhost:8000/#order[0][]=3&order[0][]=desc
missing /menu/listing
parts
I have no clue why that would happen. If on this very Github page you open the devconsole (F12) and run history.replaceState(null, 1, "#test")
, what does the URL in the address bar become? For me it correctly ends up on https://github.com/omines/datatables-bundle/pull/29#test
.
Looks like because my projects contains base href like <base href="http://localhost:8000">
Uhm yeah but that breaks most external libraries, not just ours. In general <base>
causes more issues than it fixes.
Closed in favor of #35
fix path gone