mirror of https://github.com/rivo/tview.git
Cursor fix for empty text areas / input fields. Fixes #915
This commit is contained in:
parent
05d01944a1
commit
7c9e464bac
10
textarea.go
10
textarea.go
|
@ -1218,10 +1218,14 @@ func (t *TextArea) Draw(screen tcell.Screen) {
|
|||
}
|
||||
}()
|
||||
|
||||
// Placeholder.
|
||||
if t.length == 0 && len(t.placeholder) > 0 {
|
||||
t.drawPlaceholder(screen, x, y, width, height)
|
||||
// No text / placeholder.
|
||||
if t.length == 0 {
|
||||
t.lastHeight, t.lastWidth = height, width
|
||||
t.cursor.row, t.cursor.column, t.cursor.actualColumn, t.cursor.pos = 0, 0, 0, [3]int{1, 0, -1}
|
||||
t.rowOffset, t.columnOffset = 0, 0
|
||||
if len(t.placeholder) > 0 {
|
||||
t.drawPlaceholder(screen, x, y, width, height)
|
||||
}
|
||||
return // We're done already.
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue