-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Localised number format and wrong input type for decimal fields #6566
Copy link
Copy link
Closed
Labels
Priority:1Work that is critical for the release, but we could probably ship withoutWork that is critical for the release, but we could probably ship withoutaffected-fewThis issue impacts only small number of customersThis issue impacts only small number of customersapi-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesbugThis issue describes a behavior which is not expected - a bug.This issue describes a behavior which is not expected - a bug.feature-mvc-razor-viewsFeatures related to the Razor view engine for Razor pages and MVC viewsFeatures related to the Razor view engine for Razor pages and MVC viewsinvestigateseverity-minorThis label is used by an internal toolThis label is used by an internal tool
Milestone
Metadata
Metadata
Assignees
Labels
Priority:1Work that is critical for the release, but we could probably ship withoutWork that is critical for the release, but we could probably ship withoutaffected-fewThis issue impacts only small number of customersThis issue impacts only small number of customersapi-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesbugThis issue describes a behavior which is not expected - a bug.This issue describes a behavior which is not expected - a bug.feature-mvc-razor-viewsFeatures related to the Razor view engine for Razor pages and MVC viewsFeatures related to the Razor view engine for Razor pages and MVC viewsinvestigateseverity-minorThis label is used by an internal toolThis label is used by an internal tool
Type
Fields
Give feedbackNo fields configured for issues without a type.
Describe the bug
With a model that contains a
decimalproperty, this doesn't work with a locale that uses a decimal comma:To Reproduce
Steps to reproduce the behavior:
Code:
Expected behavior
This should be the rendered HTML:
This happens instead, for the two view variants from the top:
The first issue is that the
decimaltype isn't rendered with thetype="number"attribute. If I fix this myself by adding the attribute, the field remains completely empty because there is a comma instead of a point in the value. This shouldn't be localised because then no browser or frontend library can handle the value anymore.PS: I haven't even got to try what happens when the correct value "1.0" is sent back to the controller and the model binder should convert it to a
decimaltype. It probably fails for the same reason.[User reference: Configuration/Endpoint/Edit/Factor]