-
Notifications
You must be signed in to change notification settings - Fork 334
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
Make CharacterCount use of attributes
option consistent with other components
#2893
Comments
Related: #1649 |
Given this is an issue with multiple Nunjucks parameters, would it be sensible to have a nested set of params rather than adding new top-level ones? i.e. Instead of adding {{ govukCharacterCount({
// These apply to the textarea
attributes: {},
classes: '',
id: '',
...
// These apply to the container
formGroup: {
attributes: {},
classes: '',
id: '',
...
}
}) }} That would still be internally consistent (we use |
This is now ready for review as part of #4566 I've gone with @querkmachine approach from #2893 (comment) |
What
Update CharacterCount component so its
attributes
option sets attributes on the root tag of the component, instead of the textarea. To still allow setting attributes on thetextarea
, introduce atextareaAttributes
.This'll require a two step approach where:
textareaAttributes
option and:attributes
to the root tagattributes
to the textarea like we do now and warn users that the meaning of theattributes
option will soon change and encourage usingtextareaAttributes
attributes
to the root tagWhy
This'll make the component consistent with the rest of the other components which set attributes on their root tag, for ex. allowing them to set a
lang
attribute without having to wrap the component.Who needs to work on this
Developers
Who needs to review this
Developers
Done when
textareaAttributes
option is introduced and used for picking on which tagattributes
applyattributes
The text was updated successfully, but these errors were encountered: