Skip to content

Comments

feat: Support additional custom offset in case of pinned header above…#116

Open
Ortes wants to merge 1 commit intoquire-io:masterfrom
Ortes:master
Open

feat: Support additional custom offset in case of pinned header above…#116
Ortes wants to merge 1 commit intoquire-io:masterfrom
Ortes:master

Conversation

@Ortes
Copy link

@Ortes Ortes commented Sep 20, 2024

No breaking change (I think)
Add support for addition custom offset.

.scrollToIndex() now takes an additional nullable offset parameter which move the final offset by this amount.

@jerrywell
Copy link
Member

jerrywell commented Sep 21, 2024

Hi @Ortes,

This feature can actually be achieved using an alternative method.

e.g.

await scrollController.scrollToIndex(10);
await scrollController.animateTo(scrollController.offset + [Offset], ...);

since the underlying implementation works the same way. : )

@Ortes
Copy link
Author

Ortes commented Sep 23, 2024

Indeed it works but it does not have the exact same behavior because it scroll to the offset then backward (I put negative values because I have a pinned header above so I need to offset negatively)

@jerrywell
Copy link
Member

Sorry for the late response; there was a permission issue with this repo.

Regarding your case with the pinned header, is viewportBoundaryGetter sufficient for your needs?
You can refer to this README and search for this term.

We are trying to keep the number of arguments in the interface as minimal as possible to maintain simplicity for everyone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants