From cde91dd71a89d1f82bc87dabe95643cc93853e50 Mon Sep 17 00:00:00 2001 From: Pan Zhang Date: Fri, 13 Mar 2026 16:32:51 +0800 Subject: animatedheightwidget: prevent viewport scrolling The search field moves upwards and becomes obscured when pressing navigation keys like the down arrow. This happens because the underlying QScrollArea processes keyboard navigation events, shifting the visible viewport even when scrollbars are completely hidden and disabled. Move the event filter from the contents container directly to the QScrollArea (m_contentsContainerParent) and its viewport. Update the filter to intercept Qt::Key_Up and Qt::Key_Down events, preventing the scroll area from handling these inputs. BUG: 510469 --- src/animatedheightwidget.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/animatedheightwidget.h') diff --git a/src/animatedheightwidget.h b/src/animatedheightwidget.h index 3933df93f..92701bd25 100644 --- a/src/animatedheightwidget.h +++ b/src/animatedheightwidget.h @@ -57,8 +57,9 @@ protected: protected: /** - * Ignore PageUp/PageDown key events to prevent the internal QScrollArea - * (with an invisible scrollbar) from scrolling while editing inside child widgets. + * Ignore Up/Down/PageUp/PageDown key events for the internal QScrollArea + * (with an invisible scrollbar) to prevent it from scrolling and moving the + * visible region of contained widgets such as the search bar. */ bool eventFilter(QObject *obj, QEvent *event) override; -- cgit v1.3