mirror of
https://github.com/rivo/tview.git
synced 2025-04-24 13:48:56 +08:00
Don't focus text views in forms. Fixes #797
This commit is contained in:
parent
c1eadf1b0b
commit
7dfff1ce78
6
form.go
6
form.go
@ -761,6 +761,12 @@ func (f *Form) MouseHandler() func(action MouseAction, event *tcell.EventMouse,
|
||||
|
||||
// Determine items to pass mouse events to.
|
||||
for _, item := range f.items {
|
||||
// Exclude TextView items from mouse-down events as they are
|
||||
// read-only items and thus should not be focused.
|
||||
if _, ok := item.(*TextView); ok && action == MouseLeftDown {
|
||||
continue
|
||||
}
|
||||
|
||||
consumed, capture = item.MouseHandler()(action, event, setFocus)
|
||||
if consumed {
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user