Bug 435604

Summary: Cursor position is not set properly for autocompleted search query when the textbox loses focus
Product: [Plasma] krunner Reporter: Kishore Gopalakrishnan <kishore96>
Component: generalAssignee: Alexander Lohnau <alexander.lohnau>
Status: RESOLVED FIXED    
Severity: minor CC: plasma-bugs-null
Priority: NOR    
Version First Reported In: 5.21.4   
Target Milestone: ---   
Platform: Other   
OS: Other   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Kishore Gopalakrishnan 2021-04-11 07:01:46 UTC
SUMMARY
When a query string is autocompleted and the user navigates to the results, krunner does not set the cursor position properly to the end of the string. This means that when the user later presses 'backspace', it starts deleting from the middle of the string.

STEPS TO REPRODUCE
1. Open krunner
2. Type something for which a completion exists (but don't type the entire completed string)
3. Press the down arrow
4. Press backspace twice

OBSERVED RESULTS
The cursor starts deleting from the place where the user stopped typing, not from the end of the completed query.

EXPECTED RESULTS
Backspace should delete characters starting from the end of the query.


SOFTWARE/OS VERSIONS
Linux distro: Arch Linux
KDE Plasma Version: 5.21.4
KDE Frameworks Version: 5.80.0
Qt Version: 5.15.2
Kernel Version: 5.11.12-arch1-1

ADDITIONAL INFORMATION
Comment 1 Bug Janitor Service 2021-04-11 07:11:32 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/778
Comment 2 Alexander Lohnau 2021-04-15 10:29:03 UTC
Git commit bee08091f3c9f6153948009793f2a590a5bb58bb by Alexander Lohnau.
Committed on 15/04/2021 at 10:28.
Pushed by alex into branch 'master'.

krunner: Always set cursor position to end when focusing search field

M  +1    -0    lookandfeel/contents/runcommand/RunCommand.qml

https://invent.kde.org/plasma/plasma-workspace/commit/bee08091f3c9f6153948009793f2a590a5bb58bb
Comment 3 Alexander Lohnau 2021-04-15 10:30:13 UTC
Git commit f5503e9a565390d264b2cfd28a48d71a66c51bce by Alexander Lohnau.
Committed on 15/04/2021 at 10:30.
Pushed by alex into branch 'Plasma/5.21'.

krunner: Always set cursor position to end when focusing search field


(cherry picked from commit bee08091f3c9f6153948009793f2a590a5bb58bb)

M  +1    -0    lookandfeel/contents/runcommand/RunCommand.qml

https://invent.kde.org/plasma/plasma-workspace/commit/f5503e9a565390d264b2cfd28a48d71a66c51bce