New feature: field hints for forms inputs #2405
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey!
Thank you for the nice gem! 😄
I use it from quite some time and now I'm here to propose a small feature: adding optional hints (as small text lines) below form input fields.
I'm opening the PR in draft as proof of concept, if you like the idea I could complete it (with tests / anything needed).
I'm using this feature in a couple of projects, I think it can help offering context information to the users.
The changes should be minimal, I just added a div below
div.field-unit__field
and set basic styles for the new element.I also had to add
flex-wrap: wrap;
to.field-unit
in order to place the new div on a new line.In another version I was passing the hint via field options but now I prefer the translations way because in any case the string would be stored there for my projects.
Sample locale:
The effect is like the following:
Please let me know your opinion 🙏