Bug 470923

Summary: When search result are updated, the field text cursor position is placed at the field end
Product: [Applications] dolphin Reporter: esperluette08
Component: searchAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: REPORTED ---    
Severity: minor CC: kfm-devel
Priority: NOR    
Version: 23.04.1   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description esperluette08 2023-06-12 02:49:40 UTC
SUMMARY
When searching in a folder in Dolphin, the search term is updated after some delay. If the user moves the text cursor position in this field before the end of the delay, the text cursor position is set in the field end after the delay.

Editing the field can become quite difficult when removing/inserting characters in the middle of the search term.

STEPS TO REPRODUCE
1. Activate search in Dolphin
2. Enter a search term
3. *Before* the search delay ends, move the text cursor in the middle of the search term
4. Wait for the search delay to end
5. Press any key to edit the search term 

OBSERVED RESULT
The pressed character is added to the end of the search term (since the cursor if placed at the end when delay ends).

EXPECTED RESULT
The text cursor position should stay unchanged, and so the inserted character placed where the text cursor was before the delay ended.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Neon Live (20230504-0714)
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.106.0
Qt Version: 5.15.9
Graphics: X11 on Neon