Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion textarea/textarea.go
Original file line number Diff line number Diff line change
Expand Up @@ -1554,7 +1554,7 @@ func (m Model) placeholderView() string {
}

m.viewport.SetContent(s.String())
return styles.Base.Render(m.viewport.View())
return m.viewport.View()
}

// Blink returns the blink command for the virtual cursor.
Expand Down
17 changes: 17 additions & 0 deletions textarea/textarea_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1889,6 +1889,23 @@ func TestView(t *testing.T) {
cursorRow: 7,
},
},
{
name: "empty textarea with placeholder and styled border",
modelFunc: func(m Model) Model {
m.SetHeight(2)
m.SetWidth(20)
m.Placeholder = "line 1"
m.styles.Focused.Base = lipgloss.NewStyle().Border(lipgloss.NormalBorder())
return m
},
want: want{
view: heredoc.Doc(`┌────────────────────┐
│> 1 line 1 │
│> │
└────────────────────┘
`),
},
},
}

for _, tt := range tests {
Expand Down