Skip to content

Fix list autoscroll#6427

Open
AmeeteSh-A wants to merge 5 commits into
fyne-io:developfrom
AmeeteSh-A:fix-list-autoscroll
Open

Fix list autoscroll#6427
AmeeteSh-A wants to merge 5 commits into
fyne-io:developfrom
AmeeteSh-A:fix-list-autoscroll

Conversation

@AmeeteSh-A

Copy link
Copy Markdown
Contributor

Description:

This change addresses issue #6306 by implementing auto-scroll stickiness for widget.List. Previously, when items were appended to the list, the scroll position remained static, which was problematic for use cases like chat logs or real-time feeds where users expect the view to stay locked to the bottom if they are already there.

The implementation captures the scroll state before the list Refresh() and determines if the user is at the bottom of the content. If they are, it programmatically triggers ScrollToBottom() after the layout update, preserving the expected "sticky" behavior.

Fixes #6306

Checklist:

  • Tests included.
  • Lint and formatter run with no errors.
  • Tests all pass.

@coveralls

coveralls commented Jul 18, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 59.84% (+0.007%) from 59.833% — AmeeteSh-A:fix-list-autoscroll into fyne-io:develop

@dweymouth

Copy link
Copy Markdown
Contributor

This is not desirable behavior all the time for all uses of List. I think it will need a new API (either a method or a property on the list struct) to control whether auto-scroll-to-bottom should be activated or not.

@AmeeteSh-A

Copy link
Copy Markdown
Contributor Author

This is not desirable behavior all the time for all uses of List. I think it will need a new API (either a method or a property on the list struct) to control whether auto-scroll-to-bottom should be activated or not.

Fair call, just added an AutoScroll bool property to the List struct.., and updated the tests

Comment thread widget/list.go
@sdassow

sdassow commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

This also came up in the community meeting yesterday. And I think @andydotxyz suggested the idea of a gravity attribute before as well, which would be able to support auto scroll up, down, or not at all.

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.

widget.List: Keep list scrolled to bottom when appending list item, if list is already scrolled to bottom

5 participants