-
Notifications
You must be signed in to change notification settings - Fork 20
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
Text Area Max Length #706
Text Area Max Length #706
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noticed a typo but looks good otherwise 👍
...features/ui-kit/components/form-docs/components/text-area-docs/text-area-docs.component.html
Outdated
Show resolved
Hide resolved
@StevenUlmer, what if we also add on the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of things in addition to my question about attribute vs property binding:
- Should we add default values and add some logic to ensure that the
minlength
can't be set to greater than themaxlength
, like what was done here? - Should we technically use brackets when setting the binding values since the inputs are of type
number
rather thanstring
? Maybe not worth caring about...
[attr.maxlength]="maxlength || null" | ||
[attr.minlength]="minlength || null" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question I have about this is whether we should be using attr.
for these. In the Angular docs it says: "It is recommended that you set an element property with a property binding whenever possible."
Also here it says "Attributes initialize DOM properties and then they are done. Property values can change; attribute values can't." I'm wondering if that means that when you use attr.
it makes the binding static (i.e. it won't update if the value is changed)?
These two things make me think maybe we should just property binding here, unless the text-area
s don't have these properties.
5380688
to
4e65dae
Compare
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Resolves #705
What is the new behavior?
There is the ability to pass in a maxlength on the text area
Does this PR introduce a breaking change?