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

Focus and blur event get triggered unnecessarily #21841

Closed
Deepak-Ramakrisnan opened this issue Apr 15, 2024 · 12 comments
Closed

Focus and blur event get triggered unnecessarily #21841

Deepak-Ramakrisnan opened this issue Apr 15, 2024 · 12 comments
Labels
area-blazor Blazor Hybrid / Desktop, BlazorWebView platform/windows 🪟 potential-regression This issue described a possible regression on a currently supported version., verification pending s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working

Comments

@Deepak-Ramakrisnan
Copy link

Deepak-Ramakrisnan commented Apr 15, 2024

Description

When upgrading the MAUI.controls from version 8.0.7 to 8.0.20 , I'm facing the blur and focus event related issues and unexpected behaviors , Such as

1.While focusing the component again and again , focus and blur event get triggered even though component already in focused state

2.When component get focused out , focus event get triggered and also blur event get triggered twice

Steps to Reproduce

Case 1 :

1.Focus the component again and again without blurring it
(mouse click again and again inside the input)

output: Now the focus and blur event triggered for every click unnecessarily

Case 2:

1.Focus and Focus out the element

Output : Now the focus event triggered once and blur event triggered twice

Link to public reproduction project repository

https://github.com/Deepak-Ramakrisnan/MAUI_Blur_Focus_issue

Version with bug

8.0.20 SR4

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

8.0.7 SR2

Affected platforms

Windows

Affected platform versions

Blazor Maui app

Did you find any workaround?

No response

Relevant log output

No response

@Deepak-Ramakrisnan Deepak-Ramakrisnan added the t/bug Something isn't working label Apr 15, 2024
@jsuarezruiz jsuarezruiz added platform/windows 🪟 area-blazor Blazor Hybrid / Desktop, BlazorWebView labels Apr 15, 2024
@jsuarezruiz jsuarezruiz added this to the Backlog milestone Apr 15, 2024
@XamlTest XamlTest added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Apr 16, 2024
@XamlTest
Copy link

Verified on VS 17.10.0 Preview 3.0(8.0.20). Repro on Windows 11 with below Project:
MauiBlazorApp.zip

@samhouts samhouts added the potential-regression This issue described a possible regression on a currently supported version., verification pending label Apr 22, 2024
@ITaluone
Copy link

ITaluone commented May 24, 2024

Can anybody confirm this: set the .NET SDK to 8.0.203 via global.json

"sdk": {
        "version": "8.0.203",
        "rollForward": "latestMajor"
    }

For me this seems to be working...

Edit: Today this isn't working anymore.. I have no clue why, I haven't changed anything...

@mitchelsellers
Copy link

mitchelsellers commented May 30, 2024

This issue resulted in us pulling back a new product launch. We have managed to deploy to production by pinning the MAUI version in the .csproj file, we did have to complete a full regression test of our application again, which delayed launch and has started to impact management's confidence in .NET MAUI.

This is a critical issue for us, as overall this resulted in key breaks for us in many areas.

  • Third-party control usages (SyncFusion)
  • Standard HTML Element Issues (Selects, and similar)
  • Standard HTML Behavior breaks that relied on these events (For us it was expand/collapse type actions)

Pinning back to <MauiVersion>8.0.7</MauiVersion> has resulted in allowing us to at least release to production, but any further versions forward and the functionality of our application is essentially toast across all platforms.

@mitchelsellers
Copy link

@ITaluone You may try using a <MauiVersion> as we did, rather than an SDK pin, as that did not seem to help us.

@BethMassi
Copy link

I believe this is related to a WinAppSDK bug: microsoft/microsoft-ui-xaml#9288 which has been fixed and is being teed up for a 1.5 servicing release.

@thirstyape
Copy link

thirstyape commented May 30, 2024

Wow, I was going crazy trying to figure out why one of my components wasn't working correctly. Turns out blur was firing before it should have. Anyhow, this bug still exists in MAUI 8.0.40.

@BethMassi any idea on the timing of 1.5? This is a pretty big problem but I don't really want to lose the massive amount of other fixes between 8.0.7 and 8.0.40. The word fix currently appears 191 times on the first MAUI Releases Page.

@BethMassi
Copy link

@thirstyape I just asked microsoft/microsoft-ui-xaml#9288 (comment)
If the fix gets into servicing there then it would release on Jun 11. However, it won't flow into MAUI right away as we need to test it. You could reference a newer WinAppSdk package in your CSProj like:

 <ItemGroup Condition="'$(TargetFramework)'=='net8.0-windows10.0.19041.0'">
   <PackageReference Include="Microsoft.WindowsAppSDK" Version="1.5.3*" />
 </ItemGroup>

However, unless you are experiencing other issues with MauiVersion 8.0.7 then I'd recommend waiting until we pull it in.

@ITaluone
Copy link

ITaluone commented Jun 6, 2024

I can confirm that this is working again with 1.6 experimental by adding

<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">
    <PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.240531000-experimental1" />
</ItemGroup>

and

<WindowsSdkPackageVersion>10.0.22621.35-preview</WindowsSdkPackageVersion>

@BethMassi
Copy link

This is working for me with the latest MAUI serving release 8.0.61 (which we bumped to use the WindowsAppSDK 1.5.4 servicing release).

@samhouts samhouts removed s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Jul 3, 2024
@ITaluone
Copy link

ITaluone commented Jul 8, 2024

Ahm.. am I missing something?
I bumped the MAUI version to 8.0.61 and removed the manual bump of the WASDK.

But it doesn't work since (when I look at the transitive resolved dependencies)
MAUI.Controls -> MAUI.Core -> WindowsAppSDK 1.5.240311000 (which is the latest version with this bug)

image

Manually bump to <PackageReference Include="Microsoft.WindowsAppSDK" Version="1.5.240607001" /> fixes this issue (again)

@BethMassi
Copy link

Sorry @ITaluone looks like it's fixed in SR7 (8.0.70) which released to NuGet today.
https://github.com/dotnet/maui/blob/release/8.0.1xx-sr7/eng/Versions.props#L63

@ITaluone
Copy link

ITaluone commented Jul 10, 2024

Sorry @ITaluone looks like it's fixed in SR7 (8.0.70) which released to NuGet today.

No worries :) Just wanted to make sure there isn't an issue on my side

@samhouts samhouts added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Jul 10, 2024
@mkArtakMSFT mkArtakMSFT modified the milestones: Backlog, .NET 9 Planning Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Blazor Hybrid / Desktop, BlazorWebView platform/windows 🪟 potential-regression This issue described a possible regression on a currently supported version., verification pending s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants