Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating the browser history should take into account URL fragment identifiers #1976

Closed
afercia opened this issue Jul 22, 2017 · 1 comment
Closed

Comments

@afercia
Copy link
Contributor

afercia commented Jul 22, 2017

When saving a post, REQUEST_POST_UPDATE_SUCCESS does its job and at the end updates the browser history, appending the post ID to the URL in the browser's address bar.

However, it currently doesn't take into account URL fragment identifiers such as the ones appended to the URL when using the "skip links", leading to unexpected behaviors.

The easiest way to reproduce is:

  • go in the Gutenberg "New Post" page
  • using the keyboard, tab to make the "Skip to main content" link appear
  • press Enter to activate the skip link
  • the initial URL parameter changes from ?page=gutenberg to ?page=gutenberg#wpbody-content
  • write something in the post and save
  • in the address bar there's now something like ?page=gutenberg%23wpbody-content&post_id=2395, notice the hash # has been URL encoded and the URL fragment identifier is now part of the page parameter name
  • refresh the page
  • since the page gutenberg%23wpbody-content doesn't exist, all you get is:

screen shot 2017-07-22 at 13 02 53

Worth noting this happens also with other fragment identifiers ("skip to toolbar" or any other one that plugins might use).

@westonruter
Copy link
Member

@afercia give #1984 a try.

Tug pushed a commit that referenced this issue Mar 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants