Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleting an item with unsaved changes warns about unsaved changes even though the item has already been deleted #8146

Closed
3 tasks done
HitomiTenshi opened this issue Sep 20, 2021 · 1 comment · Fixed by #8158
Assignees
Labels

Comments

@HitomiTenshi
Copy link
Contributor

Preflight Checklist

Describe the Bug

I was editing an item and realized that it was not needed anymore, so I pressed the delete button.

First the dialog for "are you sure you want to delete" appears, if you press "Delete" another dialog pops up and asks "are you sure you want to leave this page" because of unsaved changes.

The issue now is that by pressing the "Delete" button, the item has already been deleted. The unsaved changes warning message that appears is somewhat confusing. If I press "Discard Changes" everything is fine and I land back at the collection page.

If I press "Keep Editing" I get back to the "are you sure you want to delete" dialog. Clicking "Cancel" here gets you back to the item you were editing, but the problem now is that in reality this item is already deleted and what you see is its ghost data 😄.

When pressing the "Delete" button on an item with unsaved changes it should just delete it and not warn about unsaved changes.

To Reproduce

  1. Edit an item
  2. Press delete
  3. Confirm delete
  4. Unsaved changes warning appears (but the item is already deleted)

What version of Directus are you using?

v9.0.0-rc.93

What version of Node.js are you using?

14.17.6

What database are you using?

MariaDB 10.3.31

What browser are you using?

Chrome

What operating system are you using?

Windows

How are you deploying Directus?

running locally via npm package

@joselcvarela
Copy link
Member

IMO, this is what should happen:
If we click the delete button, the delete popup should appear but the save changes popup should not appear.

@azrikahar azrikahar self-assigned this Sep 20, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants