Skip to content

Subclassing of Form components doesn't work well #8192

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

Closed
rynowak opened this issue Mar 4, 2019 · 1 comment
Closed

Subclassing of Form components doesn't work well #8192

rynowak opened this issue Mar 4, 2019 · 1 comment
Assignees
Labels
area-blazor Includes: Blazor, Razor Components bug This issue describes a behavior which is not expected - a bug. Done This issue has been fixed

Comments

@rynowak
Copy link
Member

rynowak commented Mar 4, 2019

I tried subclassing EditNumber to implement something similar to this

It doesn't work because the genered code from a razor file calls base.BuildRenderTree - you get the rendering of the base class and what you wrote.

image

We should be able to fix this by making it unnecessary for a component to call base.BuildRenderTree. In general, it's a good idea if we can avoid extensibility points where an inheritor has to call base

@rynowak rynowak added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label Mar 4, 2019
@mkArtakMSFT mkArtakMSFT added bug This issue describes a behavior which is not expected - a bug. 1 - Ready area-blazor Includes: Blazor, Razor Components labels Mar 6, 2019
@mkArtakMSFT mkArtakMSFT added this to the 3.0.0-preview5 milestone Mar 6, 2019
@arivoir
Copy link

arivoir commented Mar 13, 2019

Completely agree, we should not be forced to call the base. Currently if the base is not called the StateHasChanged stops working.

@mkArtakMSFT mkArtakMSFT added Done This issue has been fixed and removed 2 - Working labels Mar 29, 2019
@mkArtakMSFT mkArtakMSFT removed area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates labels May 9, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Dec 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components bug This issue describes a behavior which is not expected - a bug. Done This issue has been fixed
Projects
None yet
Development

No branches or pull requests

5 participants