Skip to content

Commit 7b11d34

Browse files
authored
Validation: accessibility improvements (#6480)
* validate on blur * UseValidationOnBlur * AriaRequired * validation feedback * adjust fluentui2 * tailwind validation * bulma validation * fix fluent passwordstrength * bulma rte * material * markdown validation demo * fix markdown colors * markdown styles * antdesign * bootstrap * test * bulma check * bulma markdown * fluent markdown * tailwind markdown * fix validation examples * fix validation selectors * material selectors * tailwind selectors * bulma selectors * fluent selectors * antdesign selectors * always apply AriaRequired
1 parent eb06ef2 commit 7b11d34

159 files changed

Lines changed: 2409 additions & 420 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Demos/Blazorise.Demo/Pages/Tests/MarkdownPage.razor

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,36 @@
3131
</Row>
3232
</CardBody>
3333
</Card>
34+
<Card Margin="Margin.Is4.OnY">
35+
<CardHeader>
36+
<CardTitle>Markdown validation</CardTitle>
37+
</CardHeader>
38+
<CardBody>
39+
<Validations @ref="markdownValidations" Mode="ValidationMode.Manual">
40+
<Validation Validator="@ValidationRule.IsNotEmpty">
41+
<Field>
42+
<FieldLabel>Message</FieldLabel>
43+
<FieldBody>
44+
<Markdown @bind-Value="@markdownValidationValue" MinHeight="160px">
45+
<Feedback>
46+
<ValidationError>Please enter a message.</ValidationError>
47+
</Feedback>
48+
</Markdown>
49+
</FieldBody>
50+
</Field>
51+
</Validation>
52+
<Button Color="Color.Primary" Clicked="@ValidateMarkdownAsync">Submit</Button>
53+
</Validations>
54+
</CardBody>
55+
</Card>
3456
</Column>
3557
</Row>
3658
@code {
3759
Markdown markdownRef;
60+
Validations markdownValidations;
3861

3962
string markdownValue = "# EasyMDE \n Go ahead, play around with the editor! Be sure to check out **bold**, *italic*, [links](https://google.com) and all the other features. You can type the Markdown syntax, use the toolbar, or use shortcuts like `ctrl-b` or `cmd-b`.";
63+
string markdownValidationValue;
4064

4165
string markdownHtml;
4266

@@ -56,6 +80,11 @@
5680
return Task.CompletedTask;
5781
}
5882

83+
async Task ValidateMarkdownAsync()
84+
{
85+
await markdownValidations.ValidateAll();
86+
}
87+
5988
//string fileContent;
6089
int fileProgress;
6190

Documentation/Blazorise.Docs/Pages/Docs/Components/Validations/ValidationPage.razor

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -256,19 +256,13 @@
256256
By default, the form is auto-validated on page load. To validate only after the user starts entering fields,
257257
set <Code>ValidateOnLoad</Code> to false.
258258
</DocsPageSectionHeader>
259-
<DocsPageSectionContent Outlined FullWidth>
260-
<AutoValidationExample />
261-
</DocsPageSectionContent>
262259
<DocsPageSectionSource Code="AutoValidationExample" />
263260
</DocsPageSection>
264261

265262
<DocsPageSection>
266263
<DocsPageSectionHeader Title="Validation rules">
267264
Blazorise includes some predefined validation rules, e.g.:
268265
</DocsPageSectionHeader>
269-
<DocsPageSectionContent Outlined FullWidth>
270-
<ValidationRulesExample />
271-
</DocsPageSectionContent>
272266
<DocsPageSectionSource Code="ValidationRulesExample" />
273267
</DocsPageSection>
274268

0 commit comments

Comments
 (0)