Problem
clearable exists twice for the same visible affordance. tedi-form-field has
one (default false) that renders .tedi-form-field__clear, and
tedi-time-field has its own (default true) that renders
.tedi-time-field__clear in its action row. A consumer wrapping a time field in
<tedi-form-field clearable> gets two clear buttons in the same box, and
there is no single place to turn the affordance on or off.
The cause is that DI only flows control → field: TEDI_FORM_FIELD_CONTROL lets
the field find its control, but a control can never read anything from its field.
size has the same symptom — tedi-date-field declared its own size input
that was never read (no template binding, no host class, no
tedi-date-field--* rule exists), while the real sizing came from the wrapper.
Solution
- Add
TEDI_FORM_FIELD (FormFieldContext), the mirror of
TEDI_FORM_FIELD_CONTROL, provided by tedi-form-field. Field-level settings
are declared once and read by the control.
- Declare
clearable only on tedi-form-field. Date and time fields drop their
own input and resolve formField?.clearable() ?? false.
- Add optional
ownsClearButton to FormFieldControl. Date and time set it, so
the field skips its generic clear button — their button cannot move into
form-field, because the picker button beside it is the overlay's anchor and the
design puts clear before it in the action row.
- Remove the dead
size input from tedi-date-field.
- Storybook: group
size and clearable under Form Field inputs for both
fields, matching TextField, so wrapper-owned args read separately from the
control's own.
DoD
Problem
clearableexists twice for the same visible affordance.tedi-form-fieldhasone (default
false) that renders.tedi-form-field__clear, andtedi-time-fieldhas its own (defaulttrue) that renders.tedi-time-field__clearin its action row. A consumer wrapping a time field in<tedi-form-field clearable>gets two clear buttons in the same box, andthere is no single place to turn the affordance on or off.
The cause is that DI only flows control → field:
TEDI_FORM_FIELD_CONTROLletsthe field find its control, but a control can never read anything from its field.
sizehas the same symptom —tedi-date-fielddeclared its ownsizeinputthat was never read (no template binding, no host class, no
tedi-date-field--*rule exists), while the real sizing came from the wrapper.Solution
TEDI_FORM_FIELD(FormFieldContext), the mirror ofTEDI_FORM_FIELD_CONTROL, provided bytedi-form-field. Field-level settingsare declared once and read by the control.
clearableonly ontedi-form-field. Date and time fields drop theirown input and resolve
formField?.clearable() ?? false.ownsClearButtontoFormFieldControl. Date and time set it, sothe field skips its generic clear button — their button cannot move into
form-field, because the picker button beside it is the overlay's anchor and the
design puts clear before it in the action row.
sizeinput fromtedi-date-field.sizeandclearableunderForm Field inputsfor bothfields, matching TextField, so wrapper-owned args read separately from the
control's own.
DoD
semantic-release)