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
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 committed Jun 24, 2024
1 parent 3f2f2cd commit e7935cf
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 @@ -55,6 +55,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 @@ -100,7 +110,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 e7935cf

Please sign in to comment.