fix: rename custom events matching browserEventName to use fluent prefix#4609
fix: rename custom events matching browserEventName to use fluent prefix#4609
Conversation
Co-authored-by: vnbaaij <1761079+vnbaaij@users.noreply.github.com>
Co-authored-by: vnbaaij <1761079+vnbaaij@users.noreply.github.com>
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 - 61%
|
There was a problem hiding this comment.
Pull request overview
This PR fixes a .NET 11 runtime exception that occurs when a custom Blazor event registered via blazor.registerCustomEventType() has the same name as its browserEventName. Following the same pattern established in PR #4605 (dateselected → fluentdateselected), four more events are renamed with the fluent prefix while their browserEventName values remain unchanged.
Changes:
- Four custom event type names prefixed with
fluentinindex.tsandEventHandlers.csto fix the .NET 11 conflict (scrollstart,scrollend,splitterresized,splittercollapsed) - Razor directive usages updated in
FluentSplitter.razorand theHorizontalScrollDefault.razordemo example obj/andobj\Debug/patterns added tosrc/Core.Assets/.gitignoreto prevent build artifacts from being tracked
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/Core.Assets/src/index.ts |
Renames 4 registerCustomEventType call names with fluent prefix; browserEventName values unchanged |
src/Core/Events/EventHandlers.cs |
Updates [EventHandler] attributes to match new prefixed event names |
src/Core/Components/Splitter/FluentSplitter.razor |
Updates @on directive usages to @onfluentsplittercollapsed/@onfluentsplitterresized |
examples/Demo/Shared/Pages/HorizontalScroll/Examples/HorizontalScrollDefault.razor |
Updates demo to use @onfluentscrollstart/@onfluentscrollend |
src/Core.Assets/.gitignore |
Adds obj/ patterns to prevent build artifacts from being committed |
💡 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 do not make any changes to the gitignore file |
Co-authored-by: vnbaaij <1761079+vnbaaij@users.noreply.github.com>
Pull Request
📖 Description
.NET 11 throws a runtime exception when a
blazor.registerCustomEventType()custom event name matches itsbrowserEventName. Following the fix in #4605 (dateselected→fluentdateselected), four more events had the same problem:browserEventNamescrollstartfluentscrollstartscrollstartscrollendfluentscrollendscrollendsplitterresizedfluentsplitterresizedsplitterresizedsplittercollapsedfluentsplittercollapsedsplittercollapsedFiles changed:
src/Core.Assets/src/index.ts— Addedfluentprefix to the 4registerCustomEventTypecall names;browserEventNamevalues are unchanged (they are the actual DOM events fired by the web components)src/Core/Events/EventHandlers.cs— Updated[EventHandler]attribute names accordingly (onscrollstart→onfluentscrollstart, etc.)src/Core/Components/Splitter/FluentSplitter.razor— Updated@onsplitterresized/@onsplittercollapseddirective usagesexamples/.../HorizontalScrollDefault.razor— Updated@onscrollstart/@onscrollenddirective usages in the demo🎫 Issues
👩💻 Reviewer Notes
Straightforward renaming — same pattern as #4605. No behavioral change; only the Blazor event binding names change. Any consumer using
@onscrollstart,@onscrollend,@onsplitterresized, or@onsplittercollapsedin their own Razor files will need to update to thefluent-prefixed names.📑 Test Plan
Verify on .NET 11 Preview that no console exception is thrown when loading pages using
FluentHorizontalScrollorFluentSplitter. Splitter resize/collapse and horizontal scroll start/end callbacks should continue to fire correctly.✅ Checklist
General
Component-specific
⏭ Next Steps
No further events with duplicate names remain in
index.ts.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.