From 176a1ede73abadf9cbdf1589affe6c8400f4fa34 Mon Sep 17 00:00:00 2001 From: Carlo Baratto Date: Wed, 2 Sep 2026 23:52:46 +0200 Subject: [PATCH] fix tastiera che sparisce in ricerca: remove incrementale al posto di clear() (il reset ricreava l'header col campo, perdendo il focus) --- qml/pages/MainPage.qml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qml/pages/MainPage.qml b/qml/pages/MainPage.qml index 2cf4ca4..66f541c 100644 --- a/qml/pages/MainPage.qml +++ b/qml/pages/MainPage.qml @@ -117,7 +117,11 @@ Page { function updateList(q) { q = norm(q.trim()) - resultModel.clear() + // Rimozione SENZA clear(): clear() resetta il modello e su questo kit + // ricrea l'header della lista (dove sta il SearchField) facendo + // perdere il focus -> tastiera che si chiude a ogni lettera. + if (resultModel.count > 0) + resultModel.remove(0, resultModel.count) if (q === "") { hintMsg = qsTr("Type to search among all Italian towns and known ports.") return