fix(12.2-05): mark a partly filled time-mode datepicker invalid
The partial-segment check read only DateField segments, so a time-mode field (Reka TimeField, data-reka-time-field-segment) with some segments typed was never flagged. Read both segment attributes. DatepickerField tests cover both UI-SPEC backstops (Escape focus and disabled days, the fixed-zone datetime round trip) and the partly filled time case.
This commit is contained in:
@@ -98,10 +98,11 @@ function refreshPartial(): void {
|
||||
return
|
||||
}
|
||||
// Only the editable number segments count: literals, the zone name, the
|
||||
// day period and the calendar trigger carry the same data attribute.
|
||||
const segments = Array.from(root.querySelectorAll<HTMLElement>('[data-reka-date-field-segment]')).filter((el) =>
|
||||
NUMBER_PARTS.has(el.dataset.rekaDateFieldSegment ?? ''),
|
||||
)
|
||||
// day period and the calendar trigger carry the same data attribute. A
|
||||
// date or datetime renders DateField segments, time mode TimeField ones.
|
||||
const segments = Array.from(
|
||||
root.querySelectorAll<HTMLElement>('[data-reka-date-field-segment], [data-reka-time-field-segment]'),
|
||||
).filter((el) => NUMBER_PARTS.has(el.dataset.rekaDateFieldSegment ?? el.dataset.rekaTimeFieldSegment ?? ''))
|
||||
const filled = segments.filter((el) => !el.hasAttribute('data-placeholder')).length
|
||||
partial.value = filled > 0 && filled < segments.length
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user