Skip to content

Commit

Permalink
feat(list)!: add list navigation methods (first, last, previous, next) (
Browse files Browse the repository at this point in the history
#1159)

Also cleans up the list example significantly (see also
<#1157>)
    
Fixes: <#1159>
    
BREAKING CHANGE: The `List` widget now clamps the selected index to the
bounds of the list when navigating with `first`, `last`, `previous`, and
`next`, as well as when setting the index directly with `select`.
  • Loading branch information
joshka authored Jun 24, 2024
1 parent 38bb196 commit 46977d8
Show file tree
Hide file tree
Showing 4 changed files with 411 additions and 276 deletions.
11 changes: 10 additions & 1 deletion BREAKING-CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ This is a quick summary of the sections below:

## Unreleased

### List no clamps the selected index to list ([#1159])

[#1149]: https://github.com/ratatui-org/ratatui/pull/1149

The `List` widget now clamps the selected index to the bounds of the list when navigating with
`first`, `last`, `previous`, and `next`, as well as when setting the index directly with `select`.

Previously selecting an index past the end of the list would show treat the list as having a
selection which was not visible. Now the last item in the list will be selected instead.

### Prelude items added / removed ([#1149])

The following items have been removed from the prelude:
Expand Down Expand Up @@ -101,7 +111,6 @@ To update your app:
+ let position: some_crate::Position = ...;
```

[#1149]: https://github.com/ratatui-org/ratatui/pull/1149

### Termion is updated to 4.0 [#1106]

Expand Down
Loading

0 comments on commit 46977d8

Please sign in to comment.