Add method to text input model to reset the state

This commit is contained in:
Christian Rocha
2020-05-20 13:55:09 -04:00
parent 3868858947
commit 826420a00e

View File

@@ -72,6 +72,13 @@ func (m *Model) Blur() {
m.blink = true
}
// Reset sets the input to its default state with no input.
func (m *Model) Reset() {
m.Value = ""
m.offset = 0
m.pos = 0
}
// colorText colorizes a given string according to the TextColor value of the
// model
func (m *Model) colorText(s string) string {