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

fix(editor): proper length check for history when going back in editor #3960

Merged
merged 1 commit into from
Jun 29, 2020

Conversation

erezrokah
Copy link
Contributor

@erezrokah erezrokah commented Jun 29, 2020

Fixes #3951

Using history. goBack was introduced in #3716 in order to preserve the URL state (and collection filter state) when exiting the editor.

The current history.length doesn't work when the CMS is opened from another page using a link with target="_blank".

Also see https://stackoverflow.com/questions/3588315/how-to-check-if-the-user-can-go-back-in-browser-history-or-not#answer-36645802

@erezrokah erezrokah requested a review from a team June 29, 2020 12:44
@github-actions github-actions bot added the type: bug code to address defects in shipped code label Jun 29, 2020
@erezrokah erezrokah merged commit 7ee9f2f into master Jun 29, 2020
@erezrokah erezrokah deleted the fix/editor_back branch June 29, 2020 13:19
@andreamussap
Copy link

I've tested and this is fixed now, after 2.10.51 relase. Thanks, @erezrokah

vladdu pushed a commit to vladdu/netlify-cms that referenced this pull request Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Editing a page, return arrow to abandon unsaved changes not working
2 participants