Action buttons unresponsive when coming back from node preview

Created on 12 August 2024, 9 months ago

Problem/Motivation

If this is a known issue I can't find it...

In my testing Chrome behaves fine. Firefox and Safari do not behave as I would expect.

If I click the Preview button from a node/[add|edit] page and then click the browser's Back Button (or equivalent keyboard shortcut) from that Preview page to return to the node/[add|edit] page, both the Save and Preview buttons will be unresponsive.

Oddly, if I navigate to any other page from the node/[add|edit] page, either via a link in browser, bookmark menu item, or manually typing a new address into the address bar and then use the browser's back button from there, the Save and Preview buttons will submit the form as expected.

Steps to reproduce

Standard Drupal install with "Preview before submitting" set to either "Optional" or "Required" for Basic Page
Replicated on Drupal 10.3.2 on simplytest.me (Getting build failures with 11.x there at the moment)
Firefox version 129.0
Safari version 17.6
macOS version 14.6 Sonoma
Also replicated on a co-worker's mac with different specs

Proposed resolution

Considering that Chrome works fine in my testing and that the buttons only appear to break when coming back from this one preview page, I have to believe that this is something that could, and should be fixed in core.

๐Ÿ› Bug report
Status

Active

Version

10.3 โœจ

Component
Node systemย  โ†’

Last updated about 8 hours ago

No maintainer
Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @ulethjay
  • I was able to reproduce thisโ€”once. On subsequent tries the problem didn't occur. That's odd.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia vinmayiswamy

    Hi, Iโ€™m able to reproduce this issue across multiple browsers and in a fresh Drupal 10.3.2 installation, following the steps mentioned in the issue summary. Hereโ€™s what I found:

    1. The issue occurs consistently in Chrome, Firefox, and Safari in both node edit and node add scenarios.
    2. No JavaScript errors or network issues were observed in developer tools, and there are no relevant entries in the "Recent log messages".

    Iโ€™ve attached recordings showing the issue occurring in Chrome, Firefox, and Safari. If there are any further steps we should take or additional information needed, kindly please let me know.

    Thanks!

  • No JavaScript errors or network issues were observed in developer tools

    That got me wondering... If I turn off Javascript in Firefox and then visit the node form, click "Preview", then use the browser's back button, the action buttons retain their functionality.

    On a whim, I've also tried turning off CSS and JS aggregation. Doing so doesn't seem to fix anything. Doesn't hurt to try.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States mortona2k Seattle

    We have some clients reporting this issue, saying the form was broken.

    If you refresh, the form should keep your input and allow you to save.

    However, if you change your input after previewing/clicking browser back button, then refresh, those will be lost.

    Autocomplete entity reference fields keep their values after refresh, but text input does not.

  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone

    Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to our policies.

  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia acbramley

    Confirmed via manual testing this is still an issue.

  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia acbramley

    Testing this again, it also happens with the Save button and isn't specific to nodes (try blocks for example). I think this is browser behaviour more than anything. Preview gives you a link to go back under the toolbar which should be used.

    Also changing anything in the form (e.g clicking into the body and typing) will allow submission after using the back button in the browser.

    Not sure there's anything we can do on the Drupal side to fix this.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States mortona2k Seattle

    This is a UX issue. I'm still hopeful that something can be improved.

    I did not know that you could modify the body or another field and then click save, that is working for me.

    Is it possible to put an alert on the preview page when you click back?

    Is it possible to check on the entity form if you've used the browser navigation to get here (I've never looked into this). There might be some indicator we could check.

  • The "Back to content editing" link should be a supplement, not a replacement for the browser's back button.

    Modifying content to re-enable the Save button is of little help as it requires the user to save something other than what they've previewed.

    In any case, expecting an end-user to navigate these nuances is at best impractical.

Production build 0.71.5 2024