diff --git a/Modals/ClipboardHistoryModal.qml b/Modals/ClipboardHistoryModal.qml index e7f41785..ce29702a 100644 --- a/Modals/ClipboardHistoryModal.qml +++ b/Modals/ClipboardHistoryModal.qml @@ -47,6 +47,19 @@ DankModal { clipboardHistoryModal.visible = true initializeThumbnailSystem() refreshClipboard() + + Qt.callLater(function() { + if (contentLoader.item) { + const content = contentLoader.item + if (content.children && content.children.length > 1) { + const searchField = content.children[1] + if (searchField && searchField.forceActiveFocus) { + searchField.text = "" + searchField.forceActiveFocus() + } + } + } + }) } function hide() { @@ -386,18 +399,6 @@ DankModal { clipboardHistoryModal.searchText = text updateFilteredModel() } - - Connections { - function onVisibleChanged() { - if (clipboardHistoryModal.visible) { - Qt.callLater(function () { - searchField.forceActiveFocus() - }) - } - } - - target: clipboardHistoryModal - } } Rectangle {