Conversation
… .NET 11 exception Co-authored-by: vnbaaij <1761079+vnbaaij@users.noreply.github.com>
…nore Co-authored-by: vnbaaij <1761079+vnbaaij@users.noreply.github.com>
|
✅ All tests passed successfully Details on your Workflow / Core Tests page. |
Summary - Unit Tests Code CoverageSummary
CoverageMicrosoft.FluentUI.AspNetCore.Components - 98.8%
|
There was a problem hiding this comment.
Pull request overview
This PR updates Fluent UI Blazor’s custom event registrations to avoid the .NET 11 runtime exception that occurs when a registerCustomEventType() name matches its browserEventName, by renaming the Blazor-side event types while keeping the underlying DOM event names unchanged.
Changes:
- Renamed custom event type registrations:
listboxchange→fluentlistboxchange,immediate→fluentimmediate. - Updated corresponding Blazor bindings (
[EventHandler]attributes and Razor@on*usages) to the new event names. - Updated bUnit tests to trigger the renamed custom events; added a
.gitignoreentry related tosrc/Core.Scripts/obj*.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/Core.Scripts/src/FluentUICustomEvents.ts | Renames custom event type identifiers to differ from browserEventName (DOM event name unchanged). |
| src/Core/Events/EventHandlers.cs | Updates [EventHandler] attributes to the new onfluent* event names. |
| src/Core/Components/List/FluentListbox.razor | Updates internal handler binding to @onfluentlistboxchange. |
| src/Core/Components/TextInput/FluentTextInput.razor | Updates internal handler binding to @onfluentimmediate. |
| src/Core/Components/TextArea/FluentTextArea.razor | Updates internal handler binding to @onfluentimmediate. |
| tests/Core/Components/TextInput/FluentTextInputTests.razor | Updates test event triggering to onfluentimmediate. |
| tests/Core/Components/TextArea/FluentTextAreaTests.razor | Updates test event triggering to onfluentimmediate. |
| .gitignore | Adds ignore pattern for src/Core.Scripts/obj*. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
|
@copilot implement the changes mentioned by @dvoituron. Also undo the change to the gitignore file. |
…ignore Co-authored-by: vnbaaij <1761079+vnbaaij@users.noreply.github.com>
Co-authored-by: vnbaaij <1761079+vnbaaij@users.noreply.github.com>
…fact Co-authored-by: vnbaaij <1761079+vnbaaij@users.noreply.github.com>
Co-authored-by: vnbaaij <1761079+vnbaaij@users.noreply.github.com>
Done — renamed to |
Co-authored-by: vnbaaij <1761079+vnbaaij@users.noreply.github.com>
All done — renamed to |
Pull Request
📖 Description
.NET 11 throws a runtime exception when a custom Blazor event registered via
blazor.registerCustomEventType()has the same name as itsbrowserEventName. Two events inFluentUICustomEvents.tsviolated this constraint:The new names
listchangeandtextimmediatefollow the short, descriptive naming style used by other custom events in this file (e.g.tabchange,radiochange,treechanged), consistent with the pattern established in #4605.Affected files:
FluentUICustomEvents.ts— rename both registrationsEventHandlers.cs—onlistboxchange→onlistchange,onimmediate→ontextimmediateFluentListbox.razor—@onlistboxchange→@onlistchangeFluentTextInput.razor/FluentTextArea.razor—@onimmediate→@ontextimmediate🎫 Issues
👩💻 Reviewer Notes
Pure rename — no behavioral change. The actual DOM events fired by the web components (
listboxchange,immediate) are unchanged; only the Blazor-side event type names are updated. Review focus: confirm all@on*usages and[EventHandler]attributes are consistently updated.No unrelated files are modified — the
src/Core.Scripts/.gitignoreandsrc/Core.Scripts/package-lock.jsonchanges that appeared in earlier commits have been reverted.📑 Test Plan
Existing bUnit tests for
FluentListbox,FluentTextInput, andFluentTextAreaupdated to use the renamed event names. All 103 tests pass.Smoke test: load any page using
FluentListbox,FluentTextInput, orFluentTextAreaon .NET 11 Preview and confirm no console exception about duplicate event names.✅ Checklist
General
Component-specific
⏭ Next Steps
No further follow-up expected — all known same-name violations are now resolved.
Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.