silverstripe-admin icon indicating copy to clipboard operation
silverstripe-admin copied to clipboard

Save buttons sometimes require two clicks

Open jonom opened this issue 9 years ago • 7 comments

Sometimes when you make a change in the CMS and click Save... nothing happens. The Save button gets focus, but you need to click it again to see the spinning progress indicator animation and trigger the actual save. This bug has tripped me up countless times, because I assume I've saved but I haven't.

I encounter this bug often, but I can't seem to come up with conditions to reliably reproduce it. I've seen it on 3.1 through 3.3 and assume it happens in 3.0 too. I've seen it affect page forms as well as DO edit forms (such as editing a Member in the security section).

Have other people observed this bug or is it just me?

jonom avatar Mar 18 '16 16:03 jonom

Not just you, experienced this too

christopherdarling avatar Mar 18 '16 16:03 christopherdarling

This appears to be a better buttons issue: https://github.com/unclecheese/silverstripe-gridfield-betterbuttons/issues/112

jonom avatar Mar 18 '16 16:03 jonom

I dont think so - I think that better buttons issue is this issue ^

There's definitely the problem from #3592 that causes this behaviour

dhensby avatar Mar 18 '16 16:03 dhensby

I can reproduce this bug pretty reliably with betterbuttons installed but if I remove betterbuttons the same steps don't work. That's not to say that it's definitely a better buttons issue but I can't say for sure I've seen this bug on a vanilla installation because I install the better buttons module on every website I make (cos it's sweet).

So yeah #3592 might fix this issue but I'm not sure the issue exists without better buttons installed. If anyone can confirm experiencing this bug on a site without better buttons installed that will be great to know :)

@unclecheese is the author of both the BB module and #3592 so he might have some insights on this one :D

jonom avatar Mar 18 '16 16:03 jonom

Ah. I'm talking more about this happening on pages, rather than model Admin. Still sounds related

dhensby avatar Mar 18 '16 18:03 dhensby

@unclecheese did some research in https://github.com/unclecheese/silverstripe-gridfield-betterbuttons/issues/112#issuecomment-215180293 and patched the betterbuttons behaviour, but this remains a minor usability issue when editing pages with or without betterbuttons installed.

Steps to reproduce:

  1. Open any page in the CMS
  2. Click in the title field (or any regular text field) and change the text
  3. Proceed directly to clicking the Save button (don't blur the field before hand)
  4. Instead of triggering a Save, the state of the button changes from:
    screen shot 2016-04-27 at 2 45 27 pm to screen shot 2016-04-27 at 2 45 19 pm
  5. A second click is required to trigger the actual save.

This is inconsistent behaviour because if you load a page without making any changes and click the Save button while it is in this state screen shot 2016-04-27 at 2 45 27 pm it works just fine. So it should always work on the first click.

Seems to be an issue with change detection. At the moment we only detect changes on blur instead of keyup/paste etc. so when you go directly to click the Save button after introducing a change in the form the form doesn't have enough time to react to the changed data and conflicts with / cancels out the Save button click behaviour.

Besides the fact it should fix this issue, more aggressive change detection would be a usability win I think because currently if you make a change to only one field on a page in the CMS the button state lies to you by indicating nothing has changed.

This is an issue in both SS3.x and SS4.

jonom avatar Apr 28 '16 14:04 jonom

This might be a duplicate of https://github.com/silverstripe/silverstripe-cms/issues/2309

maxime-rainville avatar Jan 06 '19 08:01 maxime-rainville