Skip to content
This repository has been archived by the owner on Dec 9, 2019. It is now read-only.

Every character press adds a new Browser history entry #41

Open
lilyball opened this issue Sep 11, 2019 · 2 comments
Open

Every character press adds a new Browser history entry #41

lilyball opened this issue Sep 11, 2019 · 2 comments

Comments

@lilyball
Copy link

This completely destroys my browser history. After playing around with this for a bit yesterday, I had to delete literally thousands of browser history entries.

Instead of setting location.href it should use history.replaceState. That way I keep a single history entry that gets updated with the state. Selecting an example could push a new history entry, but all other edit actions shouldn't.

@orta
Copy link

orta commented Oct 3, 2019

The TypeScript playground uses replace state, but unfortunately that doesn't actually mean you don't get a destroyed history.

Maybe at some point browser vendors decided to just not respect that? I've tried a few times to figure out what was going on but never found an answer

@lilyball
Copy link
Author

lilyball commented Oct 3, 2019

If browsers aren't respecting that then I think you need to stop rewriting the URL on every keypress and instead provide a button that updates the URL. As it is, I cannot use the typescript playground because of how thoroughly it destroys my history; at best I can type up my code into another editor, then copy and paste it into the playground.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants