composable-form
composable-form copied to clipboard
no custom attributes?
I need some custom attributes. data-test-id
or id
or name
for e2e tests, and autocomplete
to let browsers properly fill out login/signup forms.
I've been using Form.View.custom
so far, with CustomConfig
and it works out for styling (bootstrap in my case). However, TextFieldConfig
etc have only label
and placeholder
hardcoded into their attributes.
I am kind of lost here. Did I completely miss something?
Is this simply not possible without a PR?
Or should I start by copypasting the whole of Form.View.custom
and everything "under it"?
tried at #39
I'm in the same boat. I'd like to attach data tags and other attributes to the fields that would effect how they are rendered. As @bgrosse-midokura mentioned, TextFieldConfig.attributes
looks a good place to list them but it's type is set to TextField.Attributes
, and I don't see how that could be extended.
Updated
In the meantime I found an issue https://github.com/hecrj/composable-form/issues/32 in which @hecrj talk about this. If I understood correctly, the way to go is to define custom fields, i.e. reimplement Form
and Form.View
. It seems quite a big work though because that means reimplementing all the fields if you only want to have custom attributes.
+1