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

Windows: ScrollContainer loses position when window is resized #1606

Open
mhsmith opened this issue Oct 8, 2022 · 2 comments
Open

Windows: ScrollContainer loses position when window is resized #1606

mhsmith opened this issue Oct 8, 2022 · 2 comments
Labels
bug A crash or error in behavior. windows The issue relates to Microsoft Windows support.

Comments

@mhsmith
Copy link
Member

mhsmith commented Oct 8, 2022

To Reproduce

  • Run the app from #1604 on Windows.
  • Resize the window so the scroll bar is visible, and scroll down to the bottom.
  • Resize the window again. Even the smallest change in the window size causes the scroll position to jump back to the top.

Expected behavior

When the window is resized, the scroll position should be retained as closely as possible.

Environment:

  • Operating System: Windows 10
  • Python version: 3.8
  • Software versions:
    • Briefcase: 560c1aae87
    • Toga: 9a292f8
@mhsmith mhsmith added bug A crash or error in behavior. windows The issue relates to Microsoft Windows support. labels Oct 8, 2022
@mhsmith
Copy link
Member Author

mhsmith commented Jul 11, 2023

This is significantly improved by #1969. It now only happens when a widget inside the container is focused, in which case resizing the window will scroll the focused widget back into view.

This is a much less severe problem, so I think we can leave it for now.

@mhsmith
Copy link
Member Author

mhsmith commented Jul 11, 2023

Based on this discussion, this could be fixed with a one-line override of the ScrollToControl method. Unfortunately, Python.NET does not currently support overriding protected virtual methods (pythonnet/pythonnet#2192).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A crash or error in behavior. windows The issue relates to Microsoft Windows support.
Projects
None yet
Development

No branches or pull requests

1 participant