Commit ec034350 authored by Ismael Asensio's avatar Ismael Asensio Committed by Elvis Angelaccio
Browse files

[search] Do not update text input when it has focus

When the user is entering a search term, a delayed search will be
emmited after a few seconds. This means updating the search URL, which
in turn gets parsed and reflected back on the search input.

To avoid interrupting the user input flow and unexpectedly move the
cursor to the end, let's update the input search box only when it
doesn't have the focus.

It's still updated on other interactions such as changing the search
options or clicking a saved search on the places panel.

BUG: 423328
FIXED-IN: 20.08
parent 275d7b53
...@@ -520,7 +520,10 @@ void DolphinSearchBox::updateFromQuery(const DolphinQuery& query) ...@@ -520,7 +520,10 @@ void DolphinSearchBox::updateFromQuery(const DolphinQuery& query)
setSearchPath(QUrl::fromLocalFile(QDir::homePath())); setSearchPath(QUrl::fromLocalFile(QDir::homePath()));
} }
setText(query.text()); // If the input box has focus, do not update to avoid messing with user typing
if (!m_searchInput->hasFocus()) {
setText(query.text());
}
if (query.hasContentSearch()) { if (query.hasContentSearch()) {
m_contentButton->setChecked(true); m_contentButton->setChecked(true);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment