mirror of
https://github.com/zoriya/bubbles.git
synced 2026-08-05 04:36:07 +00:00
Don't render suggestions when textinput is not focused.
This can look confusing in forms otherwise.
This commit is contained in:
committed by
Christian Rocha
parent
1bdd4c6fb3
commit
0f9e38c9a7
@@ -1,6 +1,7 @@
|
||||
package textinput
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
@@ -29,6 +30,11 @@ func Test_CurrentSuggestion(t *testing.T) {
|
||||
if suggestion != expected {
|
||||
t.Fatalf("Error: expected first suggestion but was %s", suggestion)
|
||||
}
|
||||
|
||||
textinput.Blur()
|
||||
if strings.HasSuffix(textinput.View(), "test2") {
|
||||
t.Fatalf("Error: suggestions should not be rendered when input isn't focused. expected \"> test\" but got \"%s\"", textinput.View())
|
||||
}
|
||||
}
|
||||
|
||||
func Test_SlicingOutsideCap(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user