SelectedItems returns the current selected item in the list.
()
| 367 | |
| 368 | // SelectedItems returns the current selected item in the list. |
| 369 | func (m Model) SelectedItem() Item { |
| 370 | i := m.Index() |
| 371 | |
| 372 | items := m.VisibleItems() |
| 373 | if i < 0 || len(items) == 0 || len(items) <= i { |
| 374 | return nil |
| 375 | } |
| 376 | |
| 377 | return items[i] |
| 378 | } |
| 379 | |
| 380 | // MatchesForItem returns rune positions matched by the current filter, if any. |
| 381 | // Use this to style runes matched by the active filter. |
no test coverage detected