Skip to content

Commit bccf703

Browse files
author
RoomWithOutRoof
committed
fix(textinput): allow full placeholder display when width is 0
The early return check incorrectly truncated the placeholder to only 1 character when Width was 0. Since the comment states 'if there is no width, the placeholder can be any length', we should always show the full placeholder when Width is 0. This removes the erroneous early return that was causing only the first character of the placeholder to be visible.
1 parent 4da03b3 commit bccf703

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

textinput/textinput.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -751,11 +751,6 @@ func (m Model) placeholderView() string {
751751
m.virtualCursor.SetChar(string(p[:1]))
752752
v += m.virtualCursor.View()
753753

754-
// If the entire placeholder is already set and no padding is needed, finish
755-
if m.Width() < 1 && len(p) <= 1 {
756-
return styles.Prompt.Render(m.Prompt) + v
757-
}
758-
759754
// If Width is set then size placeholder accordingly
760755
if m.Width() > 0 {
761756
// available width is width - len + cursor offset of 1

0 commit comments

Comments
 (0)