fix: rename custom events matching browserEventName to use fluent prefix - #4609
#4609fix: rename custom events matching browserEventName to use fluent prefix#4609vnbaaij merged 5 commits intodevmicrosoft/fluentui-blazor:devfrom copilot/rename-custom-events-for-consistencymicrosoft/fluentui-blazor:copilot/rename-custom-events-for-consistencyCopy head branch name to clipboard
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>
…AspNetCore.Components.Icons (#6497) Updated [Microsoft.FluentUI.AspNetCore.Components](https://github.com/microsoft/fluentui-blazor) from 4.14.0 to 4.14.2. <details> <summary>Release notes</summary> _Sourced from [Microsoft.FluentUI.AspNetCore.Components's releases](https://github.com/microsoft/fluentui-blazor/releases)._ ## 4.14.2 ## What's Changed * [Select] Fix selected items color by @MarvinKlein1508 in microsoft/fluentui-blazor#4760 * [DesignTheme] Tolerate blocked localStorage during startup by @Copilot in microsoft/fluentui-blazor#4857 * [Chore] Prep for release and update icons by @vnbaaij in microsoft/fluentui-blazor#4869 **Full Changelog**: microsoft/fluentui-blazor@v4.14.1...v4.14.2 ## 4.14.1 ## What's Changed * Merge changes from Main by @vnbaaij in microsoft/fluentui-blazor#4516 * [AppBar] Make OnClick close popover by @vnbaaij in microsoft/fluentui-blazor#4518 * [Docs] Update keycode docs to reflect latest interface by @MarvinKlein1508 in microsoft/fluentui-blazor#4522 * Fix index.ts section causing "Illegal constructor" on older iOS devices by @GusPietrasanta-Polygon in microsoft/fluentui-blazor#4531 * [Docs] Add note about render mode and required interactivity by @MarvinKlein1508 in microsoft/fluentui-blazor#4540 * [Tabs] Call HandleOnTabChange when changing to a tab through the menu by @vnbaaij in microsoft/fluentui-blazor#4564 * [Popover] Allow tabbing inside open anchored regions, support keyboard accessible navigation for popover by @adamint in microsoft/fluentui-blazor#4561 * [DataGrid] Add OnSortChanged event callback by @vnbaaij in microsoft/fluentui-blazor#4573 * [Templates] Fix 404 in WebAssembly temp by @vnbaaij in microsoft/fluentui-blazor#4578 * Bump minimatch from 3.1.2 to 3.1.5 in /src/Core.Assets by @dependabot[bot] in microsoft/fluentui-blazor#4586 * fix: rename `dateselected` custom event to `fluentdateselected` to resolve .NET 11 exception by @Copilot in microsoft/fluentui-blazor#4605 * fix: rename custom events matching browserEventName to use fluent prefix by @Copilot in microsoft/fluentui-blazor#4609 * [General] Add accent-color in reboot.css by @wherewhere in microsoft/fluentui-blazor#4614 * [Dialog] Update docs by @vnbaaij in microsoft/fluentui-blazor#4625 * [DataGrid] Fix SelectedItems getting unselected when using pagination (and virtualization) by @vnbaaij in microsoft/fluentui-blazor#4623 * Bump flatted from 3.3.1 to 3.4.2 in /src/Core.Assets by @dependabot[bot] in microsoft/fluentui-blazor#4638 * [Docs] Fix incorrect Icon in search after Navigation by @sebbogle in microsoft/fluentui-blazor#4641 * [SplashScreen] Mark sync methods as Obsolete by @MarvinKlein1508 in microsoft/fluentui-blazor#4644 * Bump picomatch from 2.3.1 to 2.3.2 in /src/Core.Assets by @dependabot[bot] in microsoft/fluentui-blazor#4646 * [NavGroup] Fix disabled state for top-level `FluentNavGroup` by @MarvinKlein1508 in microsoft/fluentui-blazor#4647 * [NavGroup] Apply font opacity instead of color by @MarvinKlein1508 in microsoft/fluentui-blazor#4648 * Rollup PRs #4677 and and #4678 by @vnbaaij in microsoft/fluentui-blazor#4680 ## New Contributors * @GusPietrasanta-Polygon made their first contribution in microsoft/fluentui-blazor#4531 * @sebbogle made their first contribution in microsoft/fluentui-blazor#4641 **Full Changelog**: microsoft/fluentui-blazor@v4.14.0...v4.14.1 Commits viewable in [compare view](microsoft/fluentui-blazor@v4.14.0...v4.14.2). </details> Updated [Microsoft.FluentUI.AspNetCore.Components.Icons](https://github.com/microsoft/fluentui-blazor) from 4.14.2 to 4.14.3. <details> <summary>Release notes</summary> _Sourced from [Microsoft.FluentUI.AspNetCore.Components.Icons's releases](https://github.com/microsoft/fluentui-blazor/releases)._ ## 4.14.3 ## What's Changed * [Chore] Publish symbols from CI builds to internal symbol server by @tlmii in microsoft/fluentui-blazor#4910 * [Chore] Update dependencies in package.json by @dvoituron in microsoft/fluentui-blazor#4946 * [Docs] Update link to v5 docs by @MarvinKlein1508 in microsoft/fluentui-blazor#4927 * Update icons and prep for release by @vnbaaij in microsoft/fluentui-blazor#4958 **Full Changelog**: microsoft/fluentui-blazor@v4.14.2...v4.14.3 Commits viewable in [compare view](microsoft/fluentui-blazor@v4.14.2...v4.14.3). </details> Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Djuradj Kurepa <dkurepa@microsoft.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.