-
-
Notifications
You must be signed in to change notification settings - Fork 472
Open
Description
Describe the feature
ℹ️ I've recently started looking into the DateField component, but from my brief investigation, I couldn't find answers for what I'll consider now as feature requests for it.
-
Format filled segments with leading zeros
Whether via a new prop or a formatting function, I'd like to have a possibility of displaying a leading0for date segments, namely for day and month;- I see now that this automatically happens depending on the current locale...
-
Possibility to tell if a segment has a value or not
I believe this is possible right now, by checking if the value for a given segment is actually a number, but a built-in mechanism would be preferableThis is useful to style the segment accordingly. For example:No value: color it like a placeholder (like a shade of gray)Has value: color it like a regular input value (like black)
- I was able to customize it via
data-[placeholder]class
-
Possibility of having a property (data-attribute, for example) on the Root component, that informs if one of the segments currently has a focus.
- This is useful to display an outline on the root input, similar to what a regular text input would have, if it was focused.
- I managed to solve it by placing
@focus/@blurevents on theDateFieldInputcomponents that update a ref. Then I used adata-focusedattribute on theDateFieldRootbased on that ref value. Not sure if that's the right approach, though...
Apologies if any of these features already exist. I simply wasn't able to figure them out.
Additional information
- I intend to submit a PR for this feature.
- I have already implemented and/or tested this feature.
Metadata
Metadata
Assignees
Labels
No labels