Maui icon indicating copy to clipboard operation
Maui copied to clipboard

[BUG] IconTintColorBehavior in listview item loose setting (or not updated) after item filtering

Open TheSundayDev opened this issue 2 years ago • 6 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Did you read the "Reporting a bug" section on Contributing file?

  • [X] I have read the "Reporting a bug" section on Contributing file: https://github.com/CommunityToolkit/Maui/blob/main/CONTRIBUTING.md#reporting-a-bug

Current Behavior

I have a listview and as item template I have images with IconTintColorBehavior. If I filter the items multiple times the color set in TintColor is not always applied correctly and seems that is applied to the wrong item. This not happens always but often. Eg list of contacts where the background image color it's based on the initial of the name (a red, b yellow ecc...) I play with filter, I select A, then B ecc... and then all. The image color for some items is not the correct one.

IconTintColorBehavior is a very important feature but seems is not working properly

Expected Behavior

the color is the right one

Steps To Reproduce

create a list and as item template put an image with binding as

<Image.Behaviors> <toolkit:IconTintColorBehavior TintColor="{Binding ImageColor}" /> </Image.Behaviors>

2 fill the list with 20/30 items 3 filter the list based on item property (eg contact name) 4 remove filter in order to see again all items. Some of them don't have the correct ImageColor but seems are shuffled

Link to public reproduction project repository

Environment

- .NET MAUI CommunityToolkit: 9.0.3
- OS: ios android
- .NET MAUI: 8.0.82

Anything else?

No response

TheSundayDev avatar Sep 21 '24 14:09 TheSundayDev

Hi @TheSundayDev. We have added the "needs reproduction" label to this issue, which indicates that we cannot take further action. This issue will be closed automatically in 5 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

I have the same issue. If I have items in a listview or a collectionview

<toolkit:IconTintColorBehavior TintColor="{Binding ImageColor}" />

does not work. All the images are just the black image with no color applied. I've had to remove all IconTintColor from my items and add colored icons so my app can be published.

davidschlabach avatar Sep 23 '24 18:09 davidschlabach

Let me attach a video as sample. The IconTintColorBehavior is applied to the circle image in the center of each item.

We have 2 possible scenario:

  1. Item not tapped= black background and black image color
  2. Item tapped= red background and yellow image color Random tap on some items.

then randon filter tapping on 1,2,3 multiple time then click an all as you can see same images lose color setting. We have red background but black image color or black background and yellow image color. Seems that the IconTintColorBehavior is applied to wrong item index. Since I'm using a non standard List I'm also in contact with the list provider in order to check if it's related to their component.

Using CachingStrategy="CreateNewTemplate" fix the issue but the performance are worse.

https://github.com/user-attachments/assets/01efcc72-226c-4787-8c23-63f17aae83ac

thanks

TheSundayDev avatar Sep 23 '24 22:09 TheSundayDev

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 3 days. It will be closed if no further activity occurs within 2 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 3 days. It will be closed if no further activity occurs within 2 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

We haven't received a reproduction sample from you. The issue is closed.