![]() Previously we had `ScrollStrategy::ToPosition(usize)` which lets you define the offset where you want to scroll that item to. This is the same as `ScrollStrategy::Top` but imagine some space reserved at the top. This PR removes `ScrollStrategy::ToPosition` in favor of `scroll_to_item_with_offset` which is the method to do the same. The reason to add this method is that now not just `ScrollStrategy::Top` but `ScrollStrategy::Center` can also uses this offset to center the item in the remaining unreserved space. ```rs // Before scroll_handle.scroll_to_item(index, ScrollStrategy::ToPosition(offset)); // After scroll_handle.scroll_to_item_with_offset(index, ScrollStrategy::Top, offset); // New! Centers item skipping first x items scroll_handle.scroll_to_item_with_offset(index, ScrollStrategy::Center, offset); ``` This will be useful for follow up PR. Release Notes: - N/A |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
LICENSE-GPL |