| Summary: | When search field has focus, End key goes to the last entry in the results view, not the end of the search field | ||
|---|---|---|---|
| Product: | [Plasma] krunner | Reporter: | András Manţia <amantia> |
| Component: | general | Assignee: | Plasma Bugs List <plasma-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | alexander.lohnau, natalie_clarius, nate, p.r.worrall |
| Priority: | NOR | Keywords: | regression, usability |
| Version First Reported In: | 6.0.1 | ||
| Target Milestone: | --- | ||
| Platform: | openSUSE | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | 6.3.0 | |
| Sentry Crash Report: | |||
|
Description
András Manţia
2024-03-13 08:40:58 UTC
This keeps tripping me up too! The Right-Arrow key now goes to the end of the line. Only if the results view is focused, though.; if the text field is focused, then the Home and End keys behave the way you want. As such, this was an intentional change. If you want to quick focus the text field again, you can hit Ctrl+F. Sorry, but you are wrong. As the description says, this happens when you type in the lineedit. That implies the lineedit has the focus. In any other lineedit pressing end goes to the end of the text, not somewhere else. Just try it. Or try what you have suggested: press CTRL-F and End. Oh weird, this indeed does not work like it's supposed to. That's only supposed to happen when the text field doesn't have focus. Here is a proposed patch (couldn't test as right now I have some config issues to build plasma-workspace):
diff --git a/krunner/qml/RunCommand.qml b/krunner/qml/RunCommand.qml
index d7f174d938..48843057f4 100644
--- a/krunner/qml/RunCommand.qml
+++ b/krunner/qml/RunCommand.qml
@@ -228,16 +228,17 @@ ColumnLayout {
event.accepted = true;
}
}
+
+ var inCompletionMode = runnerWindow.historyBehavior === HistoryBehavior.CompletionSuggestion
+ && fadedTextCompletion.text.length > 0;
// We only need to handle the Key_End case, the first item is focused by default
- if (event.key === Qt.Key_End && results.count > 0 && cursorPosition === text.length) {
+ if (event.key === Qt.Key_End && results.count > 0 && cursorPosition === text.length && !inCompletionMode) {
results.currentIndex = results.count - 1
event.accepted = true;
focusCurrentListView()
}
- if (runnerWindow.historyBehavior === HistoryBehavior.CompletionSuggestion
- && fadedTextCompletion.text.length > 0
- && cursorPosition === text.length
- && event.key === Qt.Key_Right
+ if (inCompletionMode && cursorPosition === text.length
+ && (event.key === Qt.Key_Right || event.key == Qt.Key_End)
) {
queryField.text = fadedTextCompletion.text
fadedTextCompletion.text = ""
Can't reproduce anymore in git master; looks fixed now. |