-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add Textarea component #1204
Add Textarea component #1204
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1204 +/- ##
=======================================
Coverage 99.87% 99.87%
=======================================
Files 57 58 +1
Lines 808 812 +4
Branches 313 314 +1
=======================================
+ Hits 807 811 +4
Misses 1 1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
I just noticed, in TypeScript, the type for |
d0beae4
to
399e79f
Compare
It depends whether you count "textarea" as one word or two. From a quick Google search, |
399e79f
to
011e61a
Compare
Good point. |
6b8d386
to
f80de34
Compare
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.
LGTM, but I suggest we remove the InputGroup example, since that component was designed for single-line inputs and looks weird if you combine it with a Textarea
.
/** | ||
* Render a textarea | ||
*/ | ||
const Textarea = function Textarea({ |
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.
Can you remember the reason for the whole const Widget = function Widget(...) { ... }; export default Widget
pattern? I think it had something to do with a migration at one point.
I'd like to simplify this code back to export default function Widget(...) { ... }
when we can.
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.
Yeah, that was the reason. We had at one point some cases of const WidgetNext = function Widget() {...}
(or the other way around).
We agreed to simplify it after the old components were removed, so nothing should stop us now.
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.
OK, I filed #1215 as a reminder.
</InputGroup> | ||
</div> | ||
</Library.Demo> | ||
</Library.Pattern> |
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.
The "Textarea in an InputGroup" example looks weird:
Since we don't have an immediate use case for this, I would just remove this example. If we do want this in future, we'll need to come up with a different design that doesn't look silly. For example we could add the copy button in a footer for the control or as a standalone button in the lower-right corner.
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.
Fair enough.
This PR depends on #1196
Add a new
Textarea
component that renders consistently withInput
andSelect
.You can see how it looks by checking out this branch, running
make dev
and going to http://localhost:4001/input-textarea