-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Create input unit attributes #4454
Comments
Instead of unit-before/after, something like text-before/after might be better. You've only used units in this case, but someone might want to use it for something else. |
|
That would be more flexible but perhaps wouldn't be as semantically meaningful
Yup, you're right. I guess we'd have to have something like Which then means we'd probably need a non-exhaustive list of unit types - perhaps SI Quantities, currency and a generic one for quantities of things. e.g.
I'm starting to see why |
CLDR has a - perhaps what could be considered mostly exhaustive - list of units with their template, for example: https://github.com/unicode-cldr/cldr-units-modern/blob/master/main/en-GB/units.json. A proposal could simply reference the CLDR list and use the templates to drive the representations so for your example weight might be something like |
Aye, that's ideal actually |
Localizing numbers isn't so simple. If you wanted to have a form for person's height for example, we'd usually express it as 5ft 8in in the U.S. instead of 173cm. And the number doesn't even increment by base 10. So a significant consideration has to be made for the trade off between supporting as much localization as possible while making some localization not make the implementation / behavior complex beyond reason. |
ECMA402 limits the sanctioned single unit identifiers from CLDR that are supported in
|
Hiya,
I think it would be useful if we had unit attributes for number inputs to give users a better understanding of what the value is. Currently I just use absolutely-positioned spans to achieve this but I feel like there should be a semantic (and easier) way of doing it.
Visual Output Example:
There would need to be two not-mutually-exclusive attributes (e.g.
unit-before
andunit-after
) to account for different cultures/units/use cases. These would be displayed inside the input, with the caret moving to account for them.I can only really see these being useful for number inputs but if anyone has a valid use case then feel free to chime in.
The text was updated successfully, but these errors were encountered: