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

[Bug]: Validation : ValidationError priority for error message | Should ChildContent have an higher priority #4992

Closed
David-Moreira opened this issue Sep 9, 2023 · 0 comments
Assignees
Labels
Type: Bug 🐞 Something isn't working
Milestone

Comments

@David-Moreira
Copy link
Contributor

Blazorise Version

1.3

What Blazorise provider are you running on?

None

Link to minimal reproduction, or a simple code snippet

Something like:

<Validations @ref=_validationsRef HandlerType="ValidationHandlerType.DataAnnotation" Model="_model">
    <Validation>
        <Field>
            <FieldLabel>Phone Country Code</FieldLabel>
            <TextEdit @bind-Text="@_model.PhoneCountryCode">
                <Feedback>
                    <ValidationError>TEST</ValidationError>
                </Feedback>
            </TextEdit>
        </Field>
    </Validation>
</Validations>
<Button Clicked="Submit">Submit</Button>
@code {
    private ValidationLocalizationExample _model = new();
    private Validations _validationsRef;
    public class ValidationLocalizationExample
    {
        [RegularExpression( @"^(\+?\d{1,3}|\d{1,4})$" )]
        public string PhoneCountryCode { get; set; }
    }

    private async Task Submit()
    {
        if (await _validationsRef.ValidateAll())
        {
            Console.WriteLine( "Validation Success!" );
        }
    }
}

Steps to reproduce

Validate

What is expected?

We should consider to have an higher priority in the ValidationError ChildContent

What is actually happening?

The default error message shows, instead of what's configured explicitly in the ValidationError
This is a related issue in Blazorise Support :
https://blazorise.com/support/issues/122/validation-error-content-being-ignored-and-replaced-with-error-message-from-dataannotation

What browsers are you seeing the problem on?

No response

Any additional comments?

No response

@David-Moreira David-Moreira added the Type: Bug 🐞 Something isn't working label Sep 9, 2023
@David-Moreira David-Moreira added this to the 1.3 support milestone Sep 9, 2023
@stsrki stsrki closed this as completed Oct 18, 2023
@stsrki stsrki added this to Support Aug 3, 2024
@stsrki stsrki moved this to ✔ Done in Support Aug 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug 🐞 Something isn't working
Projects
Archived in project
Development

No branches or pull requests

2 participants