Skip to content

Conversation

@surayya-MS
Copy link
Member

Fixed bug in Sections

When implementing the final design for Sections (adding SectionName ) I forgot to change the line where we assign _registeredIdentifier in SectionContent to the identifier variable and left it as _registeredIdentifier = SectionId. This caused to not being able to remove provider for the SectionOutlet and when SectionContent with SectionName was disposed SectionOutlet was still rendering the content.
Same mistake in SectionOutlet _subscribedIdentifier = SectionId. This caused weird bug in hot reload when removing SectionOutlet with SectionName from the page resulting in error "Unhandled exception rendering component: There is already a subscriber to the content with the given section ID". Now fixed.

Added new e2e test cases when SectionContent with name gets disposed and when SectionOutlet with name gets disposed.

Fixes #47552

@surayya-MS surayya-MS requested a review from a team as a code owner April 24, 2023 20:56
@ghost ghost added the area-blazor Includes: Blazor, Razor Components label Apr 24, 2023
Copy link
Member

@MackinnonBuck MackinnonBuck left a comment

Choose a reason for hiding this comment

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

Looks great!

@surayya-MS surayya-MS merged commit 5868d21 into dotnet:main Apr 25, 2023
@ghost ghost added this to the 8.0-preview4 milestone Apr 25, 2023
@surayya-MS surayya-MS deleted the sectionsBug branch April 25, 2023 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-blazor Includes: Blazor, Razor Components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Blazor Sections don't handle SectionName correctly

3 participants