mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 21:35:54 +03:00
[PR #480] [CLOSED] Fix bug in list RemoveItem #963
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#963
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/rivo/tview/pull/480
Author: @zmnpl
Created: 7/26/2020
Status: ❌ Closed
Base:
master← Head:list-bugfix📝 Commits (1)
3947f78Fix but in list📊 Changes
1 file changed (+2 additions, -2 deletions)
View changed files
📝
list.go(+2 -2)📄 Description
When a changed function is set, deleting the first element (0-index) lead to a index out of range error because the change event was fired with index = -1.
Now the index will only be decreased if the last item was removed. As a side effect that changes the behavior of the selection slightly:
It will stay at the same place and only move up when the last item was removed.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.