Skip to content
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

Fix widget.List layout when the items length is lower than the current visible ones, fixes #1864 #1933

Merged
merged 4 commits into from Feb 12, 2021

Conversation

fpabl0
Copy link
Member

@fpabl0 fpabl0 commented Feb 10, 2021

Description:

Fixes #1864

Checklist:

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

@fpabl0 fpabl0 changed the title Fix widget.List layout when the items length is lower than the current visible ones, fixes 1864 Fix widget.List layout when the items length is lower than the current visible ones, fixes #1864 Feb 10, 2021
Copy link
Member

@andydotxyz andydotxyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you've found why this is happening, but I don't think that scrolling to the top will always be desirable in this case.

widget/list.go Show resolved Hide resolved
@andydotxyz
Copy link
Member

Thanks.
I have tested this more and it is a good fix to the crash - but there are still related issues, i.e. it seems to not correctly calculate how many items are visible:

Screenshot 2021-02-12 at 10 09 42

@andydotxyz
Copy link
Member

I think what I illustrated above is a separate issue, happy with this crash fix.

@fpabl0
Copy link
Member Author

fpabl0 commented Feb 12, 2021

I have tested this more and it is a good fix to the crash - but there are still related issues, i.e. it seems to not correctly calculate how many items are visible:

Oh I see, is there a way to reproduce it? I have just remembered that issue but after this fix, I couldn't be able to reproduce again, so I though it was fixed too 🤔

@fpabl0
Copy link
Member Author

fpabl0 commented Feb 12, 2021

@andydotxyz I have just realized you opened an issue about it.

Code to replicate is at #1864 - run it, choose 20, scroll to bottom then choose 10.

Exactly that was how I reproduced that issue before this fix. But after that, I am not able to reproduce 🤔

@fpabl0
Copy link
Member Author

fpabl0 commented Feb 12, 2021

Update: I have been able to reproduce it again, I will comment on issue instead of here, to keep this organized.

@fpabl0 fpabl0 deleted the fix/1864 branch February 21, 2021 18:44
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.

None yet

2 participants