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 horizontal scrollbar disappearing when rows removed #321

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

grokys
Copy link
Member

@grokys grokys commented Dec 3, 2024

Previously, if a horizontal scrollbar was needed to show all columns but there were no rows then no horizontal scrollbar was shown.

Fix this by getting the desired width for the TreeDataGridRowsPresenter from the columns if there are no rows.

Had to also update the test templates to include a column scroll viewer. Because the existing tests expect the column header to be of 0 height, needed to work around AvaloniaUI/Avalonia#15075 in TreeDataGridPresenterBase.

Requires another workaround for AvaloniaUI/Avalonia#15075 as the header presenter needs a height of 0 in the tests.
When items are removed, the horizontal scrollbar is reset even if the column headers do not fit in the viewport.
Fixes horizontal scrollbar disappearing when all rows removed.
@grokys grokys added the bug Something isn't working label Dec 3, 2024
@giard-alexandre
Copy link

Tested and LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants