twigfiddle icon indicating copy to clipboard operation
twigfiddle copied to clipboard

Leaving the page should not ask for confirmation when there is no change

Open stof opened this issue 8 years ago • 5 comments

When the form is kept empty or when the fiddle has just been saved without any further changes, leaving the page should not ask for confirmation.

When it asked me after I saved the fiddle, it made me wonder whether saving was done or no.

stof avatar Jan 10 '17 08:01 stof

This behavior should already be implemented. Do you have a more detailed reproduction case?

There may be some invisible state changes, like for example where you click on "Show compiled template", where a hidden checkbox is ticked to store the toggle state of the compiled template.

ninsuo avatar Jan 10 '17 08:01 ninsuo

well, if this checkbox is hidden, it should not be included in the state being checked IMO, as it is confusing (and it is not a persisted state anyway)

stof avatar Jan 10 '17 08:01 stof

Ok, will see that.

This toggle is a persisted state (on some SO questions, this is sometimes the only thing interesting in a fiddle)

ninsuo avatar Jan 10 '17 08:01 ninsuo

Sample: https://twigfiddle.com/test/3

ninsuo avatar Jan 10 '17 08:01 ninsuo

This toggle is a persisted state (on some SO questions, this is sometimes the only thing interesting in a fiddle)

The fact that it is a persistent state is something I was not aware of (and I guess it is a common case, as that's a hidden state). Maybe improving the confirmation message could fix it.

stof avatar Feb 12 '20 16:02 stof