Skip to content
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

[HxInputBase] Re-evaluate the automatic creation of an EditContext when none is found #971

Open
hakenr opened this issue Dec 17, 2024 · 2 comments

Comments

@hakenr
Copy link
Member

hakenr commented Dec 17, 2024

Blazor itself used to require explicit EditContext for input-components to work.
We implemented automatic creation of wrapping EditContext (cascading value) when we detected there is no EditContext used.
This worked pretty well!

It seems Blazor itself does not require EditContext for input-components any more.
And we found first scenario where the auto-created EditContext does bring some troubles:

Do we still need to generate the EditContext? Can we drop this feature as Blazor itself handles the scenario?
cc @jirikanda

@hakenr hakenr changed the title [HxInputBase] Re-evaluate auto creating EditContext [HxInputBase] Re-evaluate automatic EditContext creating when no EditContext found Dec 17, 2024
@hakenr hakenr changed the title [HxInputBase] Re-evaluate automatic EditContext creating when no EditContext found [HxInputBase] Re-evaluate the automatic creation of an EditContext when none is found Dec 17, 2024
@jirikanda
Copy link
Contributor

It looks custom creation of EditContext is not needed anymore. See this commit.

@jirikanda
Copy link
Contributor

But be very carefully because the EditContext instance (cascaded or auto-created) is used for component communication like HxValidationMessage. It there is no communication there is no message like parsing error etc.
EditContext is also expected in other internal component implementations (ie. HxInputDateRangeInternal). It is easy to make EditContext not-required but then it is lost communication HxInputDateRangeInternal -> HxInputDateRange -> HxValidationMessage (to be precise HxInputDateRangeInternal -> EditContext -> HxValidationMessage).
I guess, without autocreated edit context (at least) parsing error messages without EditContext will disappear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants