Conversation
WIP: TimeField
…into 573-timefield
ty2k
left a comment
There was a problem hiding this comment.
This is awesome! Very minor changes requested below, and a couple comments beyond the scope of this PR.
packages/react-components/src/components/TimeField/TimeField.css
Outdated
Show resolved
Hide resolved
| .bcds-react-aria-TimeField--Segment { | ||
| padding: var(--layout-padding-none); | ||
| } | ||
| .bcds-react-aria-TimeField--Segment[data-type="timeZoneName"] { |
There was a problem hiding this comment.
Minor thing that's annoying with the time zone thing, it's focus-able and looks just like the rest of the fields but can't actually be changed in this example (the example in the Storybook with this text above it: "The granularity prop sets the smallest unit. Choose from hour, minute (default) or second:").
Screen.Recording.2026-03-10.at.8.46.10.PM.mov
I don't think there's much to be done here. We could write a CSS rule for when aria-readonly="true", I guess? But it seems like timezones are not going to be much of a concern for us going forward. Maybe not worth thinking about.
There was a problem hiding this comment.
Yeah, this is an odd thing — there is no concept anywhere in the API of the time-zone being a thing the user sets manually, so it being a focusable segment is a bit strange.
Made a change in 25ff9d2, tweaking the styling of that specific segment to at least give a bit of a cue that this is Different to the others:
There was a problem hiding this comment.
I've also fixed the [data-disabled] case — the time-zone now follows the styling of the rest of the segments.
|
|
||
| <Canvas of={TimeFieldStories.Disabled} /> | ||
|
|
||
| Use `isReadOnly` to lock a field to its current value. A read-only input can be focused and copied, but cannot be edited: |
There was a problem hiding this comment.
Minor thing here we can't do anything about it (AFAIK), but I can't for the life of me actually highlight and copy the text in the input field without copying the label and description also:
Screen.Recording.2026-03-10.at.9.00.07.PM.mov
When I do that and paste into VS Code, I get the Unicode "pop directional isolate" character coming along for the ride:
There was a problem hiding this comment.
you are not alone on this one: adobe/react-spectrum#5285

This PR adds a new TimeField component (based on RA TimeField), building on work done by @raarielgrace as part of DDS' hackathon.
TimeField follows the pattern of other BCDS input components:
A value can be entered by:
Like DatePicker, TimeField is designed to work with objects from
@internationalized/date.By default a TimeField:
hourCycle)granularity)hideTimeZone)shouldForceLeadingZeros)Like other components, it supports medium/small sizes, and required/disabled/read-only/invalid states. A TimeField's value can be set or reading using
value, and constrained usingminValueandmaxValue.