[GH-ISSUE #158] feature request: list.RemoveItem #124

Closed
opened 2026-03-04 01:02:10 +03:00 by kerem · 4 comments
Owner

Originally created by @SamWhited on GitHub (Aug 26, 2018).
Original GitHub issue: https://github.com/rivo/tview/issues/158

Right now there is no way to remove an item from a list without clearing the list and re-adding everything. It would be nice to have a method to remove an item, probably something like:

func (l *List) RemoveItem(index int) *List
Originally created by @SamWhited on GitHub (Aug 26, 2018). Original GitHub issue: https://github.com/rivo/tview/issues/158 Right now there is no way to remove an item from a list without clearing the list and re-adding everything. It would be nice to have a method to remove an item, probably something like: ``` func (l *List) RemoveItem(index int) *List ```
kerem closed this issue 2026-03-04 01:02:11 +03:00
Author
Owner

@SamWhited commented on GitHub (Aug 26, 2018):

I started to implement this in case the request was accepted, but it occurred to me that there's non real way to track where an item ends up, or a way to sort lists, so it may be that the list view just doesn't work well for anything that's not append-only. Maybe it needs more work, or isn't the appropriate view for this.

<!-- gh-comment-id:416069392 --> @SamWhited commented on GitHub (Aug 26, 2018): I started to implement this in case the request was accepted, but it occurred to me that there's non real way to track where an item ends up, or a way to sort lists, so it may be that the list view just doesn't work well for anything that's not append-only. Maybe it needs more work, or isn't the appropriate view for this.
Author
Owner

@rivo commented on GitHub (Aug 27, 2018):

You're right, List currently lacks these functions. It should have them and I'll add them in the next few days. I'll update this issue when it's done.

<!-- gh-comment-id:416144879 --> @rivo commented on GitHub (Aug 27, 2018): You're right, `List` currently lacks these functions. It should have them and I'll add them in the next few days. I'll update this issue when it's done.
Author
Owner

@rivo commented on GitHub (Sep 5, 2018):

Apologies for getting back to you so late. This function is now part of List. Let me know in case there's anything else you need.

<!-- gh-comment-id:418689379 --> @rivo commented on GitHub (Sep 5, 2018): Apologies for getting back to you so late. This function is now part of `List`. Let me know in case there's anything else you need.
Author
Owner

@SamWhited commented on GitHub (Sep 5, 2018):

Not at all, thanks for being willing to do this and all your hard work on this library!

<!-- gh-comment-id:418749053 --> @SamWhited commented on GitHub (Sep 5, 2018): Not at all, thanks for being willing to do this and all your hard work on this library!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#124
No description provided.