charmbracelet / charmbracelet/bubbles

List: Provide Index of SelectedItem in all items

Open
#366 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
8.9k
Forks
457
Avg merge
1d 18h
Merged PRs (30d)
5

Description

With [ccmanager](https://github.com/dodevops/ccmanager) I have a backend refresh system that updates list items from time to time. It uses SetItem to update the item when it is changed and uses Index to get the index of the item to replace. However, when filtering is used, Index returns the index of the selected *filtered* item and not which index the item holds in the slice of all items.

To be backwards compatible, I'd propose a "IndexOfSelectedItem" variable to get the index of the currently selected item in the slice of all items.

Or am I missing something here?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.