Bug 423328

Summary: cursor position in search bar gets reset when search begins
Product: [Applications] dolphin Reporter: glyphimor
Component: searchAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: carcinoma, isma.af, kfm-devel, nate
Priority: NOR    
Version: 19.12.3   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In: 20.08
Sentry Crash Report:

Description glyphimor 2020-06-21 17:05:57 UTC
SUMMARY

When text is entered in the search bar, about a second after typing stops Dolphin initiates a search (without the user hitting Enter). If the user is editing the entered text when searching is initiated, the cursor position gets reset to the end of the line, potentially introducing editing mistakes.

STEPS TO REPRODUCE

1. Open Dolphin and press Ctrl-f to open the search bar
2. Enter some text, then quickly move the cursor back somewhere in the text string

OBSERVED RESULT

When search starts, cursor position is reset to end of text

EXPECTED RESULT

When search starts, cursor position doesn't change, allowing editing to continue

SOFTWARE/OS VERSIONS

Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.70.1
KDE Frameworks Version: 5.70.0
Qt Version: 5.14.2

ADDITIONAL INFORMATION

This doesn't happen in KRunner search -- maybe b/c it searches instantly when each character is entered? Whereas Dolphin seems to wait about a second before searching.
Comment 1 Bug Janitor Service 2020-07-04 15:29:21 UTC
A possibly relevant merge request was started @ https://invent.kde.org/system/dolphin/-/merge_requests/33
Comment 2 Elvis Angelaccio 2020-07-05 17:15:05 UTC
Git commit ec03435022efa72a428a43eb106eaf31f503a9e6 by Elvis Angelaccio, on behalf of Ismael Asensio.
Committed on 05/07/2020 at 17:14.
Pushed by elvisangelaccio into branch 'master'.

[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.
FIXED-IN: 20.08

M  +4    -1    src/search/dolphinsearchbox.cpp

https://invent.kde.org/system/dolphin/commit/ec03435022efa72a428a43eb106eaf31f503a9e6
Comment 3 Elvis Angelaccio 2020-10-11 15:19:54 UTC
*** Bug 427473 has been marked as a duplicate of this bug. ***