Netlify-cms: User should not be allowed to save an entry if is has not been changed

Created on 31 Aug 2017  路  2Comments  路  Source: netlify/netlify-cms

- Do you want to request a feature or report a bug?
bug

- What is the current behavior?
If an entry has not been changed, the "Save" button is still available/active, which can be a little confusing for the user. The "Save" button also still exists for new files, or ones with empty/invalid fields (with empty/invalid fields the user has no indication of failure at all except a red field name). Additionally, some backend API's may not like if we try to commit a file that has not been changed (or has no content in the case of new files). Related to #555 (only one of them has to be done).

- If the current behavior is a bug, please provide the steps to reproduce.

  1. Create a new post or open an existing one.
  2. Click "Save".

- What is the expected behavior?
If an entry has not changed, is empty, or is otherwise invalid, the "Save" button should not be available and we should definitely not try to call the backend with that entry.

bug

Most helpful comment

Great, I'm working on this, will have a PR soon.

All 2 comments

We can just use the disabled attribute, styling is already in place via React Toolbox.

Great, I'm working on this, will have a PR soon.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

TomPichaud picture TomPichaud  路  3Comments

emckay picture emckay  路  3Comments

bkroggel picture bkroggel  路  3Comments

BerkeleyTrue picture BerkeleyTrue  路  3Comments