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

ListBox Virtualization Problem #17635

Open
spacilv opened this issue Nov 28, 2024 · 6 comments
Open

ListBox Virtualization Problem #17635

spacilv opened this issue Nov 28, 2024 · 6 comments
Labels

Comments

@spacilv
Copy link

spacilv commented Nov 28, 2024

Describe the bug

Hi,
I updated from Avalonia UI v11.0.11 to 11.2.2 and discovered bug with ListBox which is maybe somehow connected to virtualization of items. Item is an expander, first bunch of visible expanders works as expected (click on header expand the item) but when I scroll down within the list where item virtualization tooks place then expanders stop working randomly. Sometimes the expander expands, sometimes not, sometimes the scroll jumps up/down after the click on expander header (see attached gif).

bug_avalonia

Minimal sample:
TestApp.zip

To Reproduce

  1. Start attached sample app
  2. Scroll down to items which are not visible after the app start
  3. Try to click on the expander header (it does not expand or scroll jumps to another location)

Expected behavior

Expander expands and does not matter where is the item placed within ListBox

Avalonia version

11.2.2

OS

macOS

Additional context

No response

@spacilv spacilv added the bug label Nov 28, 2024
@spacilv
Copy link
Author

spacilv commented Dec 1, 2024

When I do this:

<ListBox>
    <ListBox.ItemsPanel>
        <ItemsPanelTemplate>
            <StackPanel />
        </ItemsPanelTemplate>
    </ListBox.ItemsPanel>
</ListBox>

then Expander works as expected but there is a performance impact so we cannot use this workaround in production. So there is a problem with virtualization in combination with Expander variable height.

@timunie
Copy link
Contributor

timunie commented Dec 2, 2024

Yeah virtualizing different ItemSizes is already a nightmare. And if Items can change their size, this makes it not easier. You may want to clone source and add some breakpoints in ArrangeOverride if it gets even hit and if so, if size was maybe wrong catched.

@spacilv
Copy link
Author

spacilv commented Dec 6, 2024

Is there any estimate for fixing this? Avalonia v11.2.2 is unusable with this, switching off the virtualization is not an option for the production environment. Thank you.

@timunie
Copy link
Contributor

timunie commented Dec 6, 2024

Hi @spacilv

You can do 3 things:

  1. Test nightly if somehow the issue is already gone
  2. Clone Avalonia and see if you manage to fix it. If so, file a PR
  3. If you have paid support, you can ask for priority on issues

@timunie
Copy link
Contributor

timunie commented Dec 9, 2024

@spacilv I fail to understand the attached sample. It shows some custom blur effect. Could it be you uploaded a wrong repro?

@spacilv
Copy link
Author

spacilv commented Dec 9, 2024

@spacilv I fail to understand the attached sample. It shows some custom blur effect. Could it be you uploaded a wrong repro?

My bad, here is the correct one.
SampleApp.zip

We also encountered problem with publishing the app with Avalonia 11.2.2 under release configuration for win-x86 platform, we are getting app crash right after the start (11.0.13 version is ok):

Crash report:
Faulting application name: xxxxxxxxx.exe, version: xxxxxxxx, time stamp: 0x67200000
Faulting module name: coreclr.dll, version: 9.0.24.52809, time stamp: 0x672049c5
Exception code: 0xc00000fd
Fault offset: 0x0002c452
Faulting process id: 0x0x32D4
Faulting application start time: 0x0x1DB47BE8D0664FA

Exception code is Stack Overflow. This is the publish command:

dotnet publish $(AppProjectPath) -p:PublishPlatform=x86 -p:UseAppHost=true -p:PublishReadyToRunComposite=true -p:PublishReadyToRunShowWarnings=true --arch x86 --configuration release --self-contained true --output $(AppOutputDir)

When we change the configuration from release to debug within the publish command then the app works fine. x64 works fine with both release and debug configuration. When we run the app from MS Visual Studio in release/x86 then everything is also ok. We do not have the minimal repro yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants