-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
🌸 DesignLibrary
: Form
field hints
#2082
Comments
Having gone down the FormFieldComponent path; I would strongly recommend writing a FormBuilder first. |
DesignLibrary
: Form
field hints
I've cross-linked this with the DesignLibrary issue; which is pretty much a very bare skeleton. |
Yes yes, I remember now having this conversation with you @zspencer. 👍🏻 |
I would start by adding a partial called So e.g. https://github.com/zinc-collective/convene/blob/main/app/views/application/_text_field.html.erb would become: <%- disabled = local_assigns.fetch(:disabled?, false)%>
<div>
<%= form.label attribute %>
<%= form.text_field attribute, disabled: disabled %>
<%= render partial: "hint", locals: { model: form.object, attribute: attribute } %>
<%= render partial: "error", locals: { model: form.object, attribute: attribute } %>
</div> Plus a standard way of putting the hint text in the locales file, say under If/when that becomes necessary, we can start moving this into components. |
DesignLibrary
: Form
field hintsDesignLibrary
: Form
field hints
DesignLibrary
#1187As @anaulin recently noted, we lack a standard way of adding and styling form field hints. This adds some friction for devs.
Rather than leave devs to their own devices, we might create a wrapper component for form fields like
FormFieldWithHint
. Although this opens up the question of whether to build this enhancement on top of a more atomicalFormField
component.The text was updated successfully, but these errors were encountered: