Skip to content
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

[core] feat(TextArea): new autoResize prop allows input to shrink vertically #6306

Merged
merged 5 commits into from
Jul 28, 2023

Conversation

scooobs
Copy link
Contributor

@scooobs scooobs commented Jul 27, 2023

Checklist

  • Test completed (no tests for TextArea component)
  • Update documentation

Changes proposed in this pull request:

Add a fitToContent: boolean prop to TextArea component to allow for more granularity control over vertical resizing when growVertically is enabled.

Before:
image
After:
image

@adidahiya
Copy link
Contributor

Fix formatting

Build artifact links for this commit: documentation | landing | table | demo

This is an automated comment from the deploy-preview CircleCI job.

@adidahiya
Copy link
Contributor

Discussed a bit on Slack, but I think a better approach would be to name this new prop autoResize (similar to the same prop name for TagInput) and have it supersede the existing growVertically prop (which we could then mark as @deprecated in favor of autoResize).

autoResize would enable both growing & shrinking in the vertical dimension, similar to how TagInput behaves in the horizontal dimension:

2023-07-27 12 45 22
2023-07-27 12 46 16

@adidahiya
Copy link
Contributor

adidahiya commented Jul 27, 2023

no tests for TextArea component

oh, and also, there are some tests for this component. I'll admit the resizing & scroll behavior is a bit finicky to test (see #5976), but could you take a stab at testing this new behavior anyway?

@scooobs scooobs requested a review from adidahiya July 28, 2023 00:29
@adidahiya
Copy link
Contributor

Deprecated growVertically prop and added tests

Build artifact links for this commit: documentation | landing | table | demo

This is an automated comment from the deploy-preview CircleCI job.

Copy link
Contributor

@adidahiya adidahiya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll push a commit to restore support for growVertically

packages/core/test/forms/textAreaTests.tsx Outdated Show resolved Hide resolved
@adidahiya adidahiya changed the title [core] feat(TextArea): add fit to content functionality [core] feat(TextArea): new autoResize prop allows input to shrink vertically Jul 28, 2023
@adidahiya
Copy link
Contributor

fix test comments

Build artifact links for this commit: documentation | landing | table | demo

This is an automated comment from the deploy-preview CircleCI job.

@adidahiya adidahiya merged commit 65a07a4 into develop Jul 28, 2023
@adidahiya adidahiya deleted the scooobs/ta-vertical-grow branch July 28, 2023 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants