Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Confirmation popup displays when closing browser tab when page hasn't changed #4687
If I open an existing page, and then decide to close it straight away (because maybe I opened the wrong one), I'm prompted with a popup message, even when the page hasn't been touched or edited.
This happens on both Drafts and Published pages.
I raised a similar issue back in November (#3447). This was closed in favour of #3296, advising that it had been fixed in v1.7. Subsequently, #3296 has now also been closed. This issue has obviously resurfaced again.
Steps to Reproduce (for bugs)
If I haven't edited the page, I shouldn't be advised that I could be losing changes by closing the tab
I'm advised that I could lose changes by continuing on, even those nothing has changed
Don't mark the page as dirty when it hasn't changed
Related Issues and/or PRs
Firefox Quantum 57.0.4 (64-bit)
@danielbachhuber I did some more testing as per your suggestion.
When I deactivated all other plugins, I couldn't replicate the issue.
I then tried activating the plugins individually with Gutenberg....
So it seems like anything that added Custom Meta Boxes causes the issue to trigger. I hope that helps.
referenced this issue
Mar 9, 2018
referenced this issue
Nov 2, 2018
Stopping by to test and help keep an eye on this issue as I think it's important and would also like to note that steps to reproduce may be tricky pin down (especially if the problem happens intermittently or if it depends on very specific set of circumstances we haven't thought of yet here, such as changing data in meta boxes or block validation issues due to update from past plugin versions) and I'd like to keep this issue going even if I can't reproduce it straight away. Also would like to note that some recent improvements have been made around refactoring state (#10844) so it would be cool to check back in to see if others are still experiencing the issue after 4.3 (or 4.3.0-rc.1 if you help with pre-release testing!) becomes available.
I tested just now with the testing steps from the original report and I was unable to replicate the problem:
Tested with WordPress 4.9.8 and Gutenberg 4.2.0 using Firefox 63.0.1 on macOS 10.13.6.
If you are still experiencing this issue and if you are willing to provide additional details, it would be helpful to note a list of active plugins on your site, whether the unwarranted save prompt occurs consistently or not, and the type of content in the posts where the prompt is shown. Also, if you see any warnings about block validation in your browser console at the time you open the post, please note them or grab a screenshot if possible.
Plus, would like to say thank you to @maddisondesigns for raising issues like this one!
I'm able to replicate this issue consistently if I click into the Classic Editor block. Clicking into other blocks and leaving the the post or page doesn't trigger the prompt. I'm able to replicate in posts, pages, and a CPT. Here are the steps:
Tested with WordPress 4.9.8 and Gutenberg 4.2.0 using Chrome 70.0.3538.77 on macOS 10.14.1
Active plugins on the tested site:
I see this error in the console when I open a post I can replicate the issue with of these posts (I don't see this error on posts I cannot replicate the issue on):
I am able to reproduce this every time on pages that have a meta box. It happens if I open the page and try to navigate away, or if I make an edit and save, then try to navigate away. It happens every single time, 100% of the time. I am using Gutenberg version: 4.6.1.