mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-04 00:45:35 +00:00
io/router/key: add explicit tag to FocusOp; make last SoftKeyboardOp apply
The target of FocusOp is too subtle; be explicit instead and remove any doubt. Multiple SoftKeyboardOp in a single frame is rare, but if they do occur, they should behave as if they were from separate frames: the last one applies. As a side-effect the key event router can be much simplified. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+1
-1
@@ -416,7 +416,7 @@ func (e *Editor) layout(gtx layout.Context) layout.Dimensions {
|
||||
|
||||
key.InputOp{Tag: &e.eventKey}.Add(gtx.Ops)
|
||||
if e.requestFocus {
|
||||
key.FocusOp{Focus: true}.Add(gtx.Ops)
|
||||
key.FocusOp{Tag: &e.eventKey}.Add(gtx.Ops)
|
||||
key.SoftKeyboardOp{Show: true}.Add(gtx.Ops)
|
||||
}
|
||||
e.requestFocus = false
|
||||
|
||||
Reference in New Issue
Block a user