Skip to content

Commit d1988aa

Browse files
committed
Ensure we ask for focus right away when tap/click
Fixes #139
1 parent afcec15 commit d1988aa

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

term.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ func (t *Terminal) MinSize() fyne.Size {
135135

136136
// MouseDown handles the down action for desktop mouse events.
137137
func (t *Terminal) MouseDown(ev *desktop.MouseEvent) {
138+
fyne.CurrentApp().Driver().CanvasForObject(t).Focus(t)
139+
138140
if t.hasSelectedText() {
139141
t.clearSelectedText()
140142
}
@@ -295,6 +297,8 @@ func (t *Terminal) TouchCancel(ev *mobile.TouchEvent) {
295297

296298
// TouchDown handles the down action for mobile touch events.
297299
func (t *Terminal) TouchDown(ev *mobile.TouchEvent) {
300+
fyne.CurrentApp().Driver().CanvasForObject(t).Focus(t)
301+
298302
if t.onMouseDown != nil {
299303
t.onMouseDown(1, 0, ev.Position)
300304
}

0 commit comments

Comments
 (0)