this seems to fix an issue i was facing
This commit is contained in:
+3
-3
@@ -27,7 +27,7 @@ type MenuComponent struct {
|
|||||||
Style *MenuStyle
|
Style *MenuStyle
|
||||||
Items []string
|
Items []string
|
||||||
SelectedItem int
|
SelectedItem int
|
||||||
onSelected func(*MenuComponent, bool)
|
OnSelected func(*MenuComponent, bool)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *MenuComponent) GetComponentData() *osui.ComponentData {
|
func (m *MenuComponent) GetComponentData() *osui.ComponentData {
|
||||||
@@ -70,10 +70,10 @@ func (m *MenuComponent) Update(key string) bool {
|
|||||||
m.SelectedItem = len(m.Items) - 1
|
m.SelectedItem = len(m.Items) - 1
|
||||||
}
|
}
|
||||||
} else if isKey.Enter(key) {
|
} else if isKey.Enter(key) {
|
||||||
m.onSelected(m, true)
|
m.OnSelected(m, true)
|
||||||
return true
|
return true
|
||||||
} else if isKey.Char(key, "q") {
|
} else if isKey.Char(key, "q") {
|
||||||
m.onSelected(m, false)
|
m.OnSelected(m, false)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
|||||||
Reference in New Issue
Block a user