Don't use TapHandlers in TextArea/TextField
Causes conflicts on touch/pen which prevent the component from being focused. Use the normal press/pressHold signals instead.
This commit is contained in:
parent
71a2951f5b
commit
7502c1a9b4
|
@ -107,6 +107,9 @@ TextArea {
|
|||
previousDefaultText = defaultText
|
||||
}
|
||||
|
||||
onPressed: ev => { if (ev.button === Qt.RightButton) contextMenu.spawn() }
|
||||
onPressAndHold: ev => contextMenu.spawn()
|
||||
|
||||
Keys.onPressed: ev => {
|
||||
// Prevent alt/super+any key from typing text
|
||||
if (
|
||||
|
@ -181,17 +184,6 @@ TextArea {
|
|||
Behavior on opacity { HNumberAnimation {} }
|
||||
}
|
||||
|
||||
TapHandler {
|
||||
acceptedButtons: Qt.RightButton
|
||||
acceptedPointerTypes: PointerDevice.GenericPointer | PointerDevice.Pen
|
||||
onTapped: contextMenu.spawn()
|
||||
}
|
||||
|
||||
TapHandler {
|
||||
acceptedPointerTypes: PointerDevice.Finger | PointerDevice.Pen
|
||||
onLongPressed: contextMenu.spawn()
|
||||
}
|
||||
|
||||
HTextContextMenu {
|
||||
id: contextMenu
|
||||
enableCustomImagePaste: textArea.enableCustomImagePaste
|
||||
|
|
|
@ -87,6 +87,9 @@ TextField {
|
|||
previousDefaultText = defaultText
|
||||
}
|
||||
|
||||
onPressed: ev => { if (ev.button === Qt.RightButton) contextMenu.spawn() }
|
||||
onPressAndHold: ev => contextMenu.spawn()
|
||||
|
||||
// Prevent alt/super+any key from typing text
|
||||
Keys.onPressed: if (
|
||||
event.modifiers & Qt.AltModifier ||
|
||||
|
@ -146,16 +149,5 @@ TextField {
|
|||
Behavior on opacity { HNumberAnimation {} }
|
||||
}
|
||||
|
||||
TapHandler {
|
||||
acceptedButtons: Qt.RightButton
|
||||
acceptedPointerTypes: PointerDevice.GenericPointer | PointerDevice.Pen
|
||||
onTapped: contextMenu.spawn()
|
||||
}
|
||||
|
||||
TapHandler {
|
||||
acceptedPointerTypes: PointerDevice.Finger | PointerDevice.Pen
|
||||
onLongPressed: contextMenu.spawn()
|
||||
}
|
||||
|
||||
HTextContextMenu { id: contextMenu }
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user