fix(custom-model): keep the picker search box unfocused on touch devices

Round-four review item 4: focusing the search input on every picker open raises the OS keyboard over the list on phones; guard it the way readmymind-ui.js does.
This commit is contained in:
Devvyn committed 2026-11-02 17:04:01 +08:00
1 parent 181e419644
commit 2cc5f3f9e6
2 files changed
+27 -1

No files matched your search

+6 -1
View File
@@ -1106,7 +1106,12 @@ Object.assign(CodemanApp.prototype, {
const search = document.getElementById('customModelPickSearch');
if (search) {
search.value = '';
search.focus();
// readmymind-ui.js's rule: on touch devices never focus an input unprompted, or
// the OS keyboard pops over the very list the picker just opened to show. Desktop
// keeps the caret in the box, one keystroke from filtering.
if (!(typeof MobileDetection !== 'undefined' && MobileDetection.isTouchDevice())) {
search.focus();
}
}
this.filterCustomModelPick('');
},