keepassxreboot / keepassxc

KeePassXC is a cross-platform community-driven port of the Windows application “Keepass Password Safe”.
https://keepassxc.org/
Other
21.27k stars 1.47k forks source link

Delete key passes through to database widget despite active modal dialog #11217

Open dandan2244 opened 2 months ago

dandan2244 commented 2 months ago

Overview

KeePassXC 2.7.9 Mac with external Logitech Keyboard. You want to use "Save as" to save the database. In the Save As window, you left-click once and then use the Delete key on the external keyboard to delete a character. If you press the Delete key on the keyboard, this character will not be deleted. Instead, your database entry will be accidentally deleted in the background.

Steps to Reproduce

  1. You select an entry e.g. test1 that contains username and password inside
  2. Database -> Database save as
  3. The Database save as window opens
  4. Inside of the „Save as:“ you left click once that the cursor appears
  5. On the external keyboard you press the DEL key
  6. Instead of deleting the character in the “Save as:” field, the selected entry test1 is deleted from the database.

Expected Behavior

The character in the "Save as:" field is deleted

Actual Behavior

The selected entry in the background window will be deleted

Context

This only happens when I use an external keyboard. But I think I'm not the only one who uses an external keyboard, and accidentally deleting an entry in the background window is a critical behavior with unintended data loss.

It would be nice if there was a setting that required confirmation before deleting entries. This can prevent accidental deletion.

KeePassXC - 2.7.9 Revision: REVISION

Operating System: macOS

droidmonkey commented 2 months ago

There are settings that require confirmation before deleting. The default behavior is to send entries to he database recycle bin.

However, this doesn't make sense. The save as dialog is a modal dialog that captures all keyboard input and won't send any to the application. I also do not understand the difference an external keyboard would make.

droidmonkey commented 2 months ago

Despite my initial thoughts above, this is actually a bug. However I think this is a Qt bug in that focus is not properly delivered to the save as dialog. We can prevent this specific behavior from happening by ignoring delete actions when a modal dialog is active.