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

Unable to use enter key to confirm document deletion, in confirmation modal #4972

Open
toddpadwick opened this issue Oct 4, 2023 · 1 comment

Comments

@toddpadwick
Copy link

I have 200 documents to delete in the CMS. So I need to quickly delete them sequentially – I am using the shortcut to delete (CNT+ALT+D) and then attempting to press the enter key when the modal window to confirm deletion appears. However, pressing enter closes the modal. The expected behaviour would be that the enter key confirms deletion. Having to use the mouse, makes the benefit of the shortcut delete feature redundant.
To fix, I believe this simply requires the buttons to be wrapped in a form element, with the button type being a submission:

Screenshot 2023-10-04 at 08 58 43

@largis21
Copy link
Contributor

largis21 commented Oct 8, 2023

Tab twice then enter ;)

Using the sanity cli or making a script to the delete a large number of documents is much better suited than using the studio.
Here is a quick example using the javascript client:

const client = createClient({
  projectId: xxxxx,
  dataset: xxxxxxx,
  useCdn: false,
})

client.delete({ query: '*[_type == "products"]' })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants