spartan icon indicating copy to clipboard operation
spartan copied to clipboard

Add native support for HTML forms and browser autofill for primitives not using a native input

Open thatsamsonkid opened this issue 4 months ago • 2 comments

Which scope/s are relevant/related to the feature request?

Don't know / other

Information

For a few of the form primitives (checkbox,datepicker,select) where a native html input is not used, it prevents usage with Native HTML form usage or with implementations such as Analogjs Form Actions. This also probably affects functionality such browser autofill from being able to work with these primitives

Primitves affected by this:

  • Checkbox
  • Datepicker
  • Radio-group (this one might be fine, need to verify)
  • Select

Describe any alternatives/workarounds you're currently using

N/A

I would be willing to submit a PR to fix this issue

  • [x] Yes
  • [ ] No

thatsamsonkid avatar Jul 19 '25 10:07 thatsamsonkid

@thatsamsonkid what is the approach here? add a hidden input field that is kept in sync?

goetzrobin avatar Jul 21 '25 12:07 goetzrobin

@goetzrobin - yea I think this is the only thing we can do to remedy this, and where applicable we need to make sure the autocomplete attribute, at least for the autofill scope of this is easily configurable so we can support all the tokens https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/autocomplete#token_list_tokens

thatsamsonkid avatar Jul 23 '25 17:07 thatsamsonkid