[BUG] TouchBehavior scaling causes flickering
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
When you add a feature like HoverScale="0.5", placing your mouse cursor over the control will resize it accordingly. However, if as a result of the scaling the cursor is now seen as outside the area of the then-scaled control, the scaling is then reset to 1 automatically. once that happens, the cursor will again be in over the control, so it'll scale it down to 0.5 again. rinse, repeat.
Expected Behavior
Not entirely sure how to describe the correct behavior, but it shouldn't really trip over itself when applying scaling when hovering.
Steps To Reproduce
- Create a control with a TouchBehavior, preferably a large control that takes a good chunk of the screen size like shown below:
<VerticalStackLayout Padding="30,0" Spacing="25">
<Label
BackgroundColor="orange"
HeightRequest="300"
HorizontalOptions="Fill"
Text="hover this">
<Label.Behaviors>
<toolkit:TouchBehavior HoveredScale="0.5" />
</Label.Behaviors>
</Label>
</VerticalStackLayout>
- run the app and hover the mouse close to the edge of the control, so that when it scales down the mouse cursor will no longer be over the top of the scaled control.
- observe the control repeatedly going into the two scaled states.
Link to public reproduction project repository
https://github.com/MitchBomcanhao/Maui
sorry, I don't have a proper repro project as it is a very basic scenario. linked to a fork of the toolkit repository in order to be able to raise this report. the bug report form mentions we need a project link Otherwise the issue will be marked with "Needs reproduction" label and will have a lower priority. Attached zip files cannot be opened by us. which is untrue - if we don't have a link we can't even submit the report.
Environment
- .NET MAUI CommunityToolkit:8.0.1
- OS: Windows 10.0.19045.4170
- .NET MAUI: 8.0.14
Anything else?
Here is a screen recording
I've reproduced this on Windows but unsure if the same will happen on other platforms when using a pointer user interface. Don't have any to test with.
Can you provide a screen recording of this issue please? ScreenToGif is a good tool and it will help document this issue since there isn't a reproduction
@Axemasta I've updated the entry with a screen recording and the xaml for my sample UI
if you move the mouse cursor over the label text, it flickers in and out very quickly. if you leave it there, it'll scale up and down at regular intervals.