Bug 448739

Summary: [Widget] Pressing Del in an empty search field deletes the selected history item
Product: [Plasma] plasmashell Reporter: popov895 <popov895>
Component: ClipboardAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: nate, popov895, qydwhotmail
Priority: NOR Keywords: accessibility, regression
Version: master   
Target Milestone: 1.0   
Platform: Other   
OS: Other   
See Also: https://bugs.kde.org/show_bug.cgi?id=448738
Latest Commit: Version Fixed In: 5.24

Description popov895 2022-01-18 19:06:04 UTC
STEPS TO REPRODUCE

1. Set the focus on the search field
2. Delete all text in the search field
3. Press Del

OBSERVED RESULT

The selected history item is deleted

EXPECTED RESULT

Nothing happens.

SOFTWARE/OS VERSIONS

Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.23.80
KDE Frameworks Version: 5.91.0
Qt Version: 5.15.3
Graphics Platform: X11
Comment 1 popov895 2022-01-18 21:40:42 UTC
Besides, it's unexpected that pressing Del removes the selected item, while the focus is in the search field
Comment 2 Fushan Wen 2022-01-20 07:55:16 UTC
I looked into the code and found that the behavior is intended. The search field always has focus so it's the only way to make it possible to use Del to delete an clipboard item in the list.
Comment 3 popov895 2022-01-20 08:04:31 UTC
(In reply to Fushan Wen from comment #2)
> that the behavior is intended
I know it's intended, but IMO this behavior is very unexpected.
Comment 4 Fushan Wen 2022-01-20 08:24:57 UTC
When there is no highlight, pressing Del will not do anything, so https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1376 may fix the unexpected behavior.
Comment 5 Bug Janitor Service 2022-01-20 09:25:25 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1381
Comment 6 Fushan Wen 2022-01-20 12:29:06 UTC
Git commit 79344a3b26eaaa2d766b0e6b5d5a8d61193bd049 by Fushan Wen.
Committed on 20/01/2022 at 09:47.
Pushed by fusionfuture into branch 'master'.

applets/clipboard: Don't delete any item when the search field has focus

The behavior may cause unexpected results when the user spam press Del
in order to delete all characters in the search field, and find that
all items in the list are deleted.

It also causes pressing Del in the search field not deleting the fully
selected text.
Related: bug 448738

M  +0    -12   applets/clipboard/contents/ui/ClipboardPage.qml

https://invent.kde.org/plasma/plasma-workspace/commit/79344a3b26eaaa2d766b0e6b5d5a8d61193bd049
Comment 7 Fushan Wen 2022-01-20 12:33:21 UTC
Git commit 6ac38d9c493c1720834e5f587f60dfcdd14d9646 by Fushan Wen.
Committed on 20/01/2022 at 12:33.
Pushed by fusionfuture into branch 'Plasma/5.24'.

applets/clipboard: Don't delete any item when the search field has focus

The behavior may cause unexpected results when the user spam press Del
in order to delete all characters in the search field, and find that
all items in the list are deleted.

It also causes pressing Del in the search field not deleting the fully
selected text.
Related: bug 448738


(cherry picked from commit 79344a3b26eaaa2d766b0e6b5d5a8d61193bd049)

M  +0    -12   applets/clipboard/contents/ui/ClipboardPage.qml

https://invent.kde.org/plasma/plasma-workspace/commit/6ac38d9c493c1720834e5f587f60dfcdd14d9646