Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no custom attributes? #38

Open
bgrosse-midokura opened this issue Jan 28, 2020 · 3 comments
Open

no custom attributes? #38

bgrosse-midokura opened this issue Jan 28, 2020 · 3 comments

Comments

@bgrosse-midokura
Copy link

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"?

@bgrosse-midokura
Copy link
Author

tried at #39

@woochica
Copy link

woochica commented Jun 3, 2020

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 #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.

@dvekeman
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants