@@ -746,20 +746,16 @@ func (l *list[T]) GetSize() (int, int) {
747// GoToBottom implements List.
747// GoToBottom implements List.
748func (l *list[T]) GoToBottom() tea.Cmd {
748func (l *list[T]) GoToBottom() tea.Cmd {
752 l.offset = 0
749 l.offset = 0
753 l.direction = DirectionBackward
751 l.direction = DirectionBackward
754 return l.render()
752 return l.render()
757// GoToTop implements List.
755// GoToTop implements List.
758func (l *list[T]) GoToTop() tea.Cmd {
756func (l *list[T]) GoToTop() tea.Cmd {
762 l.offset = 0
757 l.offset = 0
763 l.direction = DirectionForward
759 l.direction = DirectionForward
764 return l.render()
760 return l.render()
@@ -996,14 +992,7 @@ func (l *list[T]) UpdateItem(id string, item T) tea.Cmd {
996 if hasOldItem && l.direction == DirectionBackward {
992 if hasOldItem && l.direction == DirectionBackward {
997 // if we are the last item and there is no offset
993 // if we are the last item and there is no offset
998 // make sure to go to the bottom
994 // make sure to go to the bottom
999− if inx == l.items.Len()-1 && l.offset == 0 {
1000− cmd = l.GoToBottom()
1002− cmds = append(cmds, cmd)
1005− // if the item is at least partially below the viewport
1006− } else if oldPosition < oldItem.end {
995+ if oldPosition < oldItem.end {
1007 newItem, ok := l.renderedItems.Get(item.ID())
996 newItem, ok := l.renderedItems.Get(item.ID())
1009 newLines := newItem.height - oldItem.height
998 newLines := newItem.height - oldItem.height