New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ScrollTo API on List widget #2195
ScrollTo API on List widget #2195
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nick work. Just a little suggestion to simplify a math operation.
Co-authored-by: Jacob <Jacalz@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. This looks good to me 👍
Just one little note. This seems to incorrectly mention fixing #1892 which is specific to the table widget. Did you plan to add in a fix for that as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An api “ScrollTo” should not change selection, there is a separate API that does that already.
Also the initial issue requests ScrollToBottom, would that and ScrollToTop be useful too?
@andydotxyz The "ScrollTo" API does not change the selection. It simply scrolls to the item provided to it. Any selection made on the list remains intact. |
@andydotxyz The existing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand now - apologies that I misread the code.
I was confused by the use of the word "Focus" when you were just meaning scroll to make visible. Can you please update the method name so it does not imply focus change.
You're quite right, apologies. The method name tripped me up, can you find a better name? |
I was just suggesting it because those were added to |
Oh, then it makes sense to have them for consistency. Updated the PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is an off-by-one in there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks
It seems that GitHub has a policy or blocking first-time contributor CI. I have asked it to progress now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am so sorry for forgetting about this (my head was in bug fixing) but each of the new methods needs the following comment added:
//
// Since: 2.1
@andydotxyz Thanks for pointing that out. Sorry, this is my first time on a big open source project, so still learning all the nitty-gritty. |
Don't apologise, we have a lot of processes to keep the API need and consistent. There is a load written down at https://github.com/fyne-io/fyne/wiki/Contributing |
Description:
Exposed a
ScrollTo
API that scrolls a List widget and sets the focus on the ListItem represented by the id given to the API.Fixes #2105
Checklist:
Tests included.
Lint and formatter run with no errors.
Tests all pass.
Public APIs match existing style.