-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[Windows] Fix CarouselView EmptyView display when filtering to zero items #29247
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
base: main
Are you sure you want to change the base?
Conversation
Hey there @@Shalini-Ashokan! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
{ | ||
App.WaitForElement("FilterButton"); | ||
App.Tap("FilterButton"); | ||
VerifyScreenshot(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pending snapshot on Mac.
_loopableCollectionView.IsLoopingEnabled = true; | ||
} | ||
|
||
ListViewBase.ItemTemplate = CarouselItemsViewTemplate; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only update ItemTemplate
when the value are actually changing, which reduces unnecessary UI updates and potential visual glitches.
var targetTemplate = isEmpty ? null : CarouselItemsViewTemplate;
if (ListViewBase.ItemTemplate != targetTemplate)
{
ListViewBase.ItemTemplate = targetTemplate;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jsuarezruiz, I have updated the code section based on your suggestions.
/azp run MAUI-UITests-public |
Azure Pipelines successfully started running 1 pipeline(s). |
Issue Details
On Windows platforms, both the empty view and a carousel item are displayed simultaneously when a search returns no results.
Root Cause
When filtering results to zero items in CarouselView on Windows, the handler correctly sets the EmptyView to visible but does not fully reset the current item state. As a result, both the empty view and the last carousel item remain visible.
Description of Change
Set the ItemTemplate as null and disables looping to ensure the UI is properly cleared when displaying the empty view.
Validated the behavior in the following platforms
Issues Fixed
Fixes #7150
Output ScreenShot
BeforeFix-7150.mp4
AfterFix-7150.mp4