Comments (5)
Hi,
Provided sample code is not ready-to-run. Please complement.
from fluentui-blazor.
Hi,
I am sorry. It should be ready-to-run now.
I realized when I run the app, and click submit it won't show the error message.
If i write something inside the description and clear the description again, then it will start to show the error message.
Thank you.
from fluentui-blazor.
It seems the standard HTML 5 validation checking and the FluentTextArea
are not playing together nicely. I'll need to look into that further.
In the meantime I would advise you to not use the standard HTML validation but use Blazor's icw ours. Here is what you need to do:
- add
@using System.ComponentModel.DataAnnotations
at the top of your page - add
novalidate
to yourEditForm
tag - change your
CreateBatchLeaveExcelDto
class to have:
[Required(ErrorMessage = "Description is required")]
public string? Description { get; set; }
Then clicking submit will show you an error immediately(*)
Added benefit is that it will show the errors in the correct Fluent Design (as shown above) instead of the generic design (as shown below)
(which looks way worse if you ask ,e
(*) It will show the red border if below is in your CSS somewhere. I'm currently working on this and it will be automatically included in next release
fluent-text-area.invalid::part(control),
fluent-text-field.invalid::part(root) {
outline: calc(var(--stroke-width)* 1px) solid var(--error);
}
PS: Setting `Required="true" on a field does not automatically add any checks or logic. It's sole task (currently) is to display the required indicator (the red *)
from fluentui-blazor.
Closing this as a workaround is provided
from fluentui-blazor.
Hi Vincent,
Thank you very much for the detailed explanation. It worked with your suggested changes.
from fluentui-blazor.
Related Issues (20)
- fix: FluentDatePicker does not update value when current value is null and user selects date from drop down calendar in FluentDatePicker HOT 9
- FluentNavGroup 4.8.0 exception HOT 1
- fix: MaximumSelectedOptions not limiting in FluentAutocomplete HOT 3
- fix: FluentSwitch, FluentAutocomplete and serverals other components do not align at the middle when using inside FluentDataGrid HOT 1
- docs: add information about required nodeJS version HOT 1
- fix: items number badge becomes almost invisible. Also +0 is shown in Overflow component HOT 3
- FluentMultiSplitter - Collapsed doesn't work with fixed size panel HOT 2
- fix: FluentIcon Class property ignores square brackets after update to 4.8.0 HOT 14
- Microsoft.JSInterop.JSException: element.addEventListener is not a function HOT 1
- fix: `CSSBuilder` removes valid CSS class names provided by external CSS frameworks HOT 2
- fix: Hybrid Blazor Maui is not working HOT 1
- 4.8.1 FluentDatePicker not work HOT 1
- [DataGrid] OnRowClick and SelectColumn together not as expected. HOT 7
- fix: Setting FillColor design token results in [object Object] instead of correct color HOT 1
- fix: Disabled option does not get showed as selected value when @bind-Value is equal disabled one [FluentSelect] HOT 11
- TreeView: Is it possible to have clicking anywhere on the row expand the item? HOT 1
- fix: Skeleton Component in Light Theme HOT 1
- fix: Duplicates IDs if Overflow in [Overflow] HOT 1
- fix: body background color variable HOT 5
- feat: add the ability to lock (frozen) column when scrolling horizontally in DataGrid HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fluentui-blazor.