Fix field/area left/right press with selected text
Fix bug in HTextField & HTextArea: when all text was selected, pressing left or right arrow keys to go to the beginning or end and deselect didn't respond.
This commit is contained in:
parent
24e657d193
commit
2674702a59
|
@ -95,8 +95,9 @@ TextArea {
|
||||||
|
|
||||||
// Prevent leaking arrow presses to parent elements when the carret is at
|
// Prevent leaking arrow presses to parent elements when the carret is at
|
||||||
// the beginning or end of the text
|
// the beginning or end of the text
|
||||||
Keys.onLeftPressed: event.accepted = cursorPosition === 0
|
Keys.onLeftPressed: event.accepted = cursorPosition === 0 && ! selectedText
|
||||||
Keys.onRightPressed: event.accepted = cursorPosition === length
|
Keys.onRightPressed:
|
||||||
|
event.accepted = cursorPosition === length && ! selectedText
|
||||||
|
|
||||||
KeyNavigation.priority: KeyNavigation.BeforeItem
|
KeyNavigation.priority: KeyNavigation.BeforeItem
|
||||||
KeyNavigation.tab: focusItemOnTab
|
KeyNavigation.tab: focusItemOnTab
|
||||||
|
|
|
@ -68,8 +68,9 @@ TextField {
|
||||||
|
|
||||||
// Prevent leaking arrow presses to parent elements when the carret is at
|
// Prevent leaking arrow presses to parent elements when the carret is at
|
||||||
// the beginning or end of the text
|
// the beginning or end of the text
|
||||||
Keys.onLeftPressed: event.accepted = cursorPosition === 0
|
Keys.onLeftPressed: event.accepted = cursorPosition === 0 && ! selectedText
|
||||||
Keys.onRightPressed: event.accepted = cursorPosition === length
|
Keys.onRightPressed:
|
||||||
|
event.accepted = cursorPosition === length && ! selectedText
|
||||||
|
|
||||||
|
|
||||||
property string saveName: ""
|
property string saveName: ""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user