Skip to content

Issue with resizable scroll containers #84

@lnm95

Description

@lnm95

I encountered an issue where a scroll container that changes its size ends up with an incorrect _base_offset calculation.

Minimal reproduction steps:

  • Enable visibility
  • Resize the container so it becomes scrollable
  • Scroll down to change pos
  • Disable visibility
  • Increase the container size so it is no longer scrollable
  • Enable visibility and then disable it again
  • Reduce the size
  • Enable visibility

At this point, the bug occurs: content_node.position is now zero, but pos is still preserved.

As far as I was able to determine, this happens in _update_content_margins() when computing _base_offset = ScrollLayout.calculate_base_offset(content_node, pos)

As a temporary workaround, I completely replaced ScrollLayout.calculate_base_offset() with ScrollLayout.calculate_initial_offset(). This fixed the issue for me, but I’m not sure what side effects this change might have.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions