Skip to content

Virtualize ComboBox dropdown - #1061

Merged
davidjohnoliver merged 10 commits into
masterfrom
dev/djo/combobox-virt
Jun 17, 2019
Merged

davidjohnoliver merged 10 commits into
masterfrom
dev/djo/combobox-virt

Conversation

@davidjohnoliver

@davidjohnoliver davidjohnoliver commented Jun 12, 2019 •

Copy link
Copy Markdown
Contributor

GitHub Issue (If applicable): fixes #555

PR Type

What kind of change does this PR introduce?

Feature

  • Inherit CarouselPanel from VirtualizingPanel (for now borrows layouting logic from ItemsStackPanel)
  • Fixes to measure properly on iOS
  • Ensure selected item is always in view when dropdown opens

What is the current behavior?

ComboBox dropdown isn't virtualized. Extremely slow for large numbers of items.

What is the new behavior?

Now it's virtualized.

PR Checklist

Please check if your PR fulfills the following requirements:

Breaking change:

  • If ComboBox has a modified template (eg from overriding the default Style), then the ScrollViewer hosting the ItemsPresenter needs to have its Style set to StaticResource ListViewBaseScrollViewerStyle (as here). Eg:
	<ScrollViewer x:Name="ScrollViewer"
				  xamarin:Style="{StaticResource ListViewBaseScrollViewerStyle}"
				  ...

Other information

Internal Issue (If applicable):

 - Inherit CarouselPanel from VirtualizingPanel, use ItemsStackPanelLayout
 - amend ComboBox style to support virtualization
Make the case more robust where the list initially measures with a smaller desired size than what is available, ie the items don't fill all available space.

This fixes a bug with the former logic where, after returning a smaller desired size than what was available, the list would be remeasured with that returned size, and then 'forget' that more space had been available.
Fix layout attributes not updating with dynamic sizes correctly, it seems that in some cases PreferredLayoutAttributesFittingAttributes() may be called out of order.
This can occur when Measure() is called outside of the usual loop, followed by ScrollIntoView().
@davidjohnoliver
davidjohnoliver force-pushed the dev/djo/combobox-virt branch from 21c49fd to 0d75606 Compare June 13, 2019 18:14
@davidjohnoliver

Copy link
Copy Markdown
Contributor Author

/azp run

@davidjohnoliver
davidjohnoliver merged commit 438f598 into master Jun 17, 2019
@carldebilly
carldebilly deleted the dev/djo/combobox-virt branch June 17, 2019 17:06
kazo0 added a commit to kazo0/uno that referenced this pull request Mar 6, 2026
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.

wasm: ComboBox is unreasonably slow

2 participants