Disable automatically generating hints, placeholders and labels for simple_form#7539
Conversation
e726dbc to
660d6c2
Compare
660d6c2 to
d5495f2
Compare
aduth
left a comment
There was a problem hiding this comment.
LGTM 👍
I noticed that the label_text in the legend wrapper appears to add its own label as well:
identity-idp/config/initializers/simple_form.rb
Lines 61 to 63 in 869886f
For example, commenting this line would cause a default label to be shown:
Should that be optional as well?
Also, I see it's documented in the SimpleForm documentation, but I'm not sure what default hints and placeholders were actually doing, if anything?
…imple_form changelog: Internal, Forms, Disable automatically generating hints and placeholders and labels for simple_form
d5495f2 to
41e21b4
Compare
Great catch, yes, updated.
I'm not sure, it's hard to test when it would come into effect, so I may have over-applied it. |
🛠 Summary of changes
A follow up to #7537 that is intended to address the root problem of implicitly generating labels. This is in part relying on existing tests to find issues like those in #7537. I'm not sure if we want to add some defensiveness by requiring the
label:parameter on things likeValidatedFieldComponent.The secondary benefit to this is a minor performance improvement when using
simple_form_for.simple_formattempts to find translations for each hint, placeholder and label it may create which results in some additional work. Preliminary testing shows a 2-3% reduction in memory allocation forGET /. I'm not expecting a noticeable effect in response time.