-
Notifications
You must be signed in to change notification settings - Fork 191
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
feat(textfield): add rows attribute #3332
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.
Does the use of rows
negate any of the resize values?
@@ -244,6 +247,7 @@ export class TextfieldBase extends ManageHelpText(Focusable) { | |||
?disabled=${this.disabled} | |||
?required=${this.required} | |||
?readonly=${this.readonly} | |||
rows=${ifDefined(this.rows > -1 ? this.rows : undefined)} |
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.
Using ifDefined
here makes sense. Does it imply the type of rows
should be rows?: number
?
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.
Good point, yes, it should be optional. Making it optional, the compiler will warn that this.rows
might be undefined. IfDefined
doesn't help with that situation. I followed some other properties like maxlength
and minlength
. They are optional, but not declared to be optional. Should I leave it as is? Or provide a getter
for the property to check for undefined
and > -1
?
…er/spectrum-web-components into ingo/add-rows-property
@Westbrook using the |
Closing this PR in favor of this PR #3356 |
Description
Adding the rows attribute to enable a multiline Textarea to show up with a predefined amount of rows. We need this feature for an existing feature where we replace all react-spectrum components with spectrum-web-components.
Related issue(s)
Motivation and context
Product required for Adobe Share Dialog
How has this been tested?
Screenshots (if appropriate)
Types of changes
Checklist
Best practices
This repository uses conventional commit syntax for each commit message; note that the GitHub UI does not use this by default so be cautious when accepting suggested changes. Avoid the "Update branch" button on the pull request and opt instead for rebasing your branch against
main
.