Skip to content

Conversation

versile2
Copy link
Contributor

Description

Resolves #11434
Move actual JS call to DisposeAsync method so I can use InvokeVoidAsyncWithErrorHandling suppressing error messages when circuit is disconnected.

How Has This Been Tested?

BSS with Docs.Server, WASM with UnitTests.Viewer

Type of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (fix or improvement to the website or code docs)

Checklist

  • The PR is submitted to the correct branch (dev).
  • My code follows the code style of this project.
  • I've added relevant tests.

@github-actions github-actions bot added the bug Unexpected behavior or functionality not working as intended label May 31, 2025
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
C Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@danielchalmers danielchalmers requested a review from Copilot June 1, 2025 17:16
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the disposal logic in MudInput to use InvokeVoidAsyncWithErrorHandling for the iOS blur event teardown, suppressing errors when the Blazor circuit is disconnected, and marks the old helper as obsolete.

  • Marks MudDetachBlurEventWithJS as obsolete in ElementReferenceExtensions
  • Replaces the old blur-detach helper call in MudInput.razor.cs with an error-handling JS invocation
  • Retains auto-grow destruction logic under the same error-handling approach

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
ElementReferenceExtensions.cs Added [Obsolete] to old blur-detach helper and updated its message
MudInput.razor.cs Moved blur-detach JS call into DisposeAsyncCore using error handling
Comments suppressed due to low confidence (1)

src/MudBlazor/Components/Input/MudInput.razor.cs:376

  • Add or extend unit tests to cover the new disposal path, verifying that removeOnBlurEvent is invoked correctly and errors are properly suppressed when the JS runtime is disconnected.
protected override async ValueTask DisposeAsyncCore()

@versile2
Copy link
Contributor Author

@ScarletKuro Anything I need on this one?

Copy link
Member

@danielchalmers danielchalmers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could merge this and release v8.8.0 shortly after. Got enough changes ready for it

@danielchalmers danielchalmers merged commit 81189b2 into MudBlazor:dev Jun 14, 2025
5 of 6 checks passed
@versile2 versile2 deleted the fix/inputios11434 branch July 16, 2025 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Unexpected behavior or functionality not working as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JSDisconnectedException thrown from MudBlazor.MudInput.DisposeAsyncCore()

3 participants