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
[BUG] Property validations backed by ModelObservableValidationBase are not bound to view #61
Comments
Hey @ins0mniaque 👋, Thank you for opening an issue. We will get back to you as soon as we can. Also, check out our Open Collective and consider contributing financially. https://opencollective.com/reactiveui
|
Thanks for such a detailed report!
A pull request with the fixes would be highly appreciated. We might not be completely ready with the process of refactoring the library, but anyway we'll be happy to accept the fixes. Thank you! ❤️ |
* Use OAPH instead of ROOC * Fix error sharing when last property is the same (#60) * Use the main thread scheduler in this.IsValid (70) * Switch over from BPV to IPVC (#61) * Fix duplicating validations * Bring back the scheduling fix until we ensure it finally works without it * Fix typo * Access _validationSource directly * The scheduling fix is no longer needed * Don't break ROOC public API * build(deps): bump PublicApiGenerator from 10.1.0 to 10.2.0 Bumps [PublicApiGenerator](https://github.com/PublicApiGenerator/PublicApiGenerator) from 10.1.0 to 10.2.0. - [Release notes](https://github.com/PublicApiGenerator/PublicApiGenerator/releases) - [Commits](PublicApiGenerator/PublicApiGenerator@10.1.0...10.2.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Evil serializable attributes Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Describe the bug
When using a complex validation rule specifying a property name, e.g.
and then
results in no errors in view.TextInput2Error.
This happens because ValidationContext extensions ResolveFor and ResolveForMultiple have not been updated to use the IPropertyValidationComponent interface.
This line:
ReactiveUI.Validation/src/ReactiveUI.Validation/Extensions/ValidationContextExtensions.cs
Line 41 in aa218ee
skips over ModelObservableValidationBase objects.
Steps To Reproduce
Use example mentioned before.
Expected behavior
Validation should bind to view.
Screenshots
Environment
but the bug is present on all platforms.
Additional context
I have fixed this bug by refactoring ValidationContext extensions to use the IPropertyValidationComponent interface. I attached the refactored extensions which use the GetPropertyPath extension mentioned in issue #60.
NOTE: There is another bug lurking in the ValidationContext extensions. The overloads with multiple property expressions have typos which reuse TProperty1 instead of TProperty2 or TProperty3:
ReactiveUI.Validation/src/ReactiveUI.Validation/Extensions/ValidationContextExtensions.cs
Lines 70 to 71 in aa218ee
ReactiveUI.Validation/src/ReactiveUI.Validation/Extensions/ValidationContextExtensions.cs
Lines 110 to 112 in aa218ee
ReactiveUI.Validation/src/ReactiveUI.Validation/Extensions/ValidationContextMultipleExtensions.cs
Lines 58 to 59 in aa218ee
ReactiveUI.Validation/src/ReactiveUI.Validation/Extensions/ValidationContextMultipleExtensions.cs
Lines 86 to 88 in aa218ee
I know you might be in the process of refactoring property validation, but if you are ready, I'll make a pull request.
ValidationContextExtensions.cs:
ValidationContextMultipleExtensions.cs:
The text was updated successfully, but these errors were encountered: