Skip to content

Setting hotkey to "Delete" causes deletion confirmation modal to appear regardless of context menu action id #10

Description

@AdamFipke

Original issue title: Is there a way to hide the "Are you sure you want to delete these items" popup?

In my use case where I'm using this as a video file explorer, I used api.intercept on "delete-files" in order to show my own custom confirmation modal for deleting videos (example below). However, because of this I end up getting two confirmation modals (see pictures).

 api.intercept("delete-files", ({ ids }) => {
        // Map file-manager IDs to their full VideoData items (skip folders / not-found)
        const fullItems = ids
          .map((id) => fileData.find((videoItem) => videoItem.id === id))
          .filter((item): item is VideoData => item != null && item.type === "file")

        // Populate state and open the confirmation modal
        setVideosForDeletion(fullItems)
        deleteVideosDialogRef.current?.showModal()
        return false // Return false to prevent the file-manager from handling the delete itself, see https://docs.svar.dev/react/filemanager/api/actions/delete-files
      })

Built-in confirmation modal (shows first)
Image

My custom confirmation modal (shows after clicking "OK" in the previous modal)
Image

My first thought was maybe there's a way of creating custom actions? That way I can define a new action that basically performs the same what "delete-files" does except without the confirmation modal. I couldn't quite find anything here though. Another idea is if there was some way I could pass a skipDeleteConfirmation prop somewhere.

Overall this is a pretty small issue since it just means my users need to click through a second confirmation modal. But any help would still be appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions