Qt: fix the clear button in the search boxes

On Android the keyboard keeps the word being typed out of TextInput.text
until it is committed, so the clear button didn't show for it and clearing
left the composing word behind. The box now filters and shows the clear
button by displayText, and clearing resets the input method first. The
button is a 44px target that keeps its press.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hiQsCq11CwCPnKPp9D
This commit is contained in:
Claude committed 2026-11-02 05:27:37 +00:00
1 parent 0367ff5e73
commit e050f52417
4 files changed
+42 -17

No files matched your search

+10
View File
@@ -249,6 +249,16 @@ int main(int argc, char *argv[]) {
snap("drawer");
js("drawer.query = 'ma'");
eq(js("drawer.shown.map(i => apps[i].label).join(',')"), "Gmail,Maps", "the search filters the list");
{
// the clear button empties the search and shows every app again
auto *clear = win->findChild<QQuickItem *>("searchClear");
check(clear && clear->isVisible(), "the search shows a clear button");
if (clear) tap(clear->mapToScene(QPointF(clear->width() / 2, clear->height() / 2)));
eq(js("drawer.query"), "", "tapping it clears the search");
eq(js("drawer.shown.length === apps.length"), true, "and every app shows again");
check(clear && !clear->isVisible(), "the clear button goes");
js("drawer.query = 'ma'");
}
js("drawer.openFirst()");
settle(300);
eq(js("notice"), "Open com.example.gmail/.MainActivity", "opening the first match launches it");