1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-26 14:32:52 -05:00

fix auto focusing text fields

This commit is contained in:
bbedward
2025-07-22 23:51:18 -04:00
parent 9c8c25711c
commit e94d2af9ae
6 changed files with 41 additions and 36 deletions

View File

@@ -53,8 +53,6 @@ DankModal {
}
property string searchQuery: ""
property bool shouldFocusSearch: false
function updateFilteredApps() {
filteredApps = [];
selectedIndex = 0;
@@ -216,10 +214,6 @@ DankModal {
}
}
onOpened: {
shouldFocusSearch = true;
}
onBackgroundClicked: {
spotlightOpen = false;
}
@@ -420,7 +414,6 @@ DankModal {
showClearButton: true
textColor: Theme.surfaceText
font.pixelSize: Theme.fontSizeLarge
focus: false
enabled: spotlightOpen
placeholderText: "Search applications..."
text: searchQuery
@@ -428,15 +421,14 @@ DankModal {
searchQuery = text;
searchDebounceTimer.restart();
}
Connections {
target: spotlightLauncher
function onOpened() {
if (shouldFocusSearch) {
searchField.forceActiveFocus()
searchField.selectAll()
shouldFocusSearch = false
}
searchField.forceActiveFocus();
}
function onDialogClosed() {
searchField.clearFocus();
}
}