From 79344a3b26eaaa2d766b0e6b5d5a8d61193bd049 Mon Sep 17 00:00:00 2001 From: Fushan Wen Date: Thu, 20 Jan 2022 16:48:07 +0800 Subject: [PATCH] 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. BUG: 448738 BUG: 448739 --- applets/clipboard/contents/ui/ClipboardPage.qml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/applets/clipboard/contents/ui/ClipboardPage.qml b/applets/clipboard/contents/ui/ClipboardPage.qml index 00b99779a..006509f7e 100644 --- a/applets/clipboard/contents/ui/ClipboardPage.qml +++ b/applets/clipboard/contents/ui/ClipboardPage.qml @@ -118,18 +118,6 @@ Menu { inputMethodHints: Qt.ImhNoPredictiveText - // Only override delete key behavior to delete list items if - // it would do nothing - Keys.enabled: filter.text.length == 0 || filter.cursorPosition == filter.length - Keys.onDeletePressed: { - let clipboardItemIndex = clipboardMenu.view.currentIndex - if (clipboardItemIndex != -1) { - let uuid = clipboardMenu.model.get(clipboardItemIndex).UuidRole - if (uuid) { - clipboardMenu.view.currentItem.remove(uuid); - } - } - } Connections { target: main