Bug 423328 - cursor position in search bar gets reset when search begins
Summary: cursor position in search bar gets reset when search begins
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: search (show other bugs)
Version: 19.12.3
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
: 427473 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-06-21 17:05 UTC by glyphimor
Modified: 2020-10-11 15:19 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 20.08
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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. ***