mirror of
https://github.com/Maks1mS/bubbles.git
synced 2025-01-11 14:38:10 +03:00
textinput.View can just accept a textinput.Model argument
This commit is contained in:
parent
eff931bdea
commit
154f3763f7
@ -396,12 +396,7 @@ func Update(msg tea.Msg, m Model) (Model, tea.Cmd) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// View renders the textinput in its current state.
|
// View renders the textinput in its current state.
|
||||||
func View(model tea.Model) string {
|
func View(m Model) string {
|
||||||
m, ok := model.(Model)
|
|
||||||
if !ok {
|
|
||||||
return "could not perform assertion on model"
|
|
||||||
}
|
|
||||||
|
|
||||||
// Placeholder text
|
// Placeholder text
|
||||||
if len(m.value) == 0 && m.Placeholder != "" {
|
if len(m.value) == 0 && m.Placeholder != "" {
|
||||||
return placeholderView(m)
|
return placeholderView(m)
|
||||||
|
Loading…
Reference in New Issue
Block a user