You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While type can guide the client which type of input to render, this still leaves room on how to render the value.
For example a number can have a different number of digits after the decimal point, or should be padded with 0s.
A datetime-local might be displayed just as a date when it is readOnly: true, but with time when editing the value.
In contrast to the placeholder this is not intended to be displayed to the user, but for the rendering of values.
So I'm proposing new OPTIONAL Property Elements
displayFormat is a string that instructs the interface how to render a value that is not in edit mode (maybe because it is read only).
editFormat is a string of the same format, but is used when editing the value.
If a client does not support these elements, it can just render the value as if they where not present.
As I have a strong .Net background, I propose those formats to be possible values (There is also an npm package implementing the same format clr-format):
While
type
can guide the client which type of input to render, this still leaves room on how to render the value.For example a
number
can have a different number of digits after the decimal point, or should be padded with0
s.A
datetime-local
might be displayed just as a date when it isreadOnly: true
, but with time when editing the value.In contrast to the
placeholder
this is not intended to be displayed to the user, but for the rendering of values.So I'm proposing new OPTIONAL Property Elements
displayFormat
is a string that instructs the interface how to render a value that is not in edit mode (maybe because it is read only).editFormat
is a string of the same format, but is used when editing the value.If a client does not support these elements, it can just render the value as if they where not present.
As I have a strong .Net background, I propose those formats to be possible values (There is also an npm package implementing the same format clr-format):
"{0:N2}"
, value:1234.567
, browser-locale:en-us
=>"1,234.45"
"{0:F1}"
, value:1234.567
, browser-locale:de-de
=>"1234,5"
"Foo {0} Baz"
, value:"Bar"
, browser-locale:doesn't matter
=>"Foo Bar Baz"
However I'm open minded of the structure of the string.
The text was updated successfully, but these errors were encountered: