Skip to content

Fixed bug in Sections #47870

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 25, 2023
Merged

Fixed bug in Sections #47870

merged 1 commit into from
Apr 25, 2023

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