Skip to content

feat(textarea): adjusting min-height of the textarea for ionic theme#30957

Open
rugoncalves wants to merge 22 commits intonextfrom
ROU-12443-v4
Open

feat(textarea): adjusting min-height of the textarea for ionic theme#30957
rugoncalves wants to merge 22 commits intonextfrom
ROU-12443-v4

Conversation

@rugoncalves
Copy link

@rugoncalves rugoncalves commented Feb 16, 2026

Issue number: resolves internal


What is the current behavior?

  • The height of the textarea would not correspond to the rows number, when it the row number was set to 1:
    image
  • Ionic theme specifics:
    • Some paddings and margins were applied in different place;

What is the new behavior?

  • The min-height is now respecting the rows attribute:
    image
  • The ionic theme has the following changes:
    • .textarea-size-* classes stopped forcing the min-height;

Does this introduce a breaking change?

  • Yes
  • No

Other information

Original PR

Copilot AI review requested due to automatic review settings February 16, 2026 17:58
@rugoncalves rugoncalves requested a review from a team as a code owner February 16, 2026 17:58
@rugoncalves rugoncalves requested a review from ShaneK February 16, 2026 17:58
@vercel
Copy link

vercel bot commented Feb 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ionic-framework Ready Ready Preview, Comment Feb 16, 2026 7:15pm

Request Review

@github-actions github-actions bot added the package: core @ionic/core package label Feb 16, 2026
@rugoncalves rugoncalves marked this pull request as draft February 16, 2026 17:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes an issue where textareas with the rows attribute set to 1 (or other values) would not properly respect the row count due to forced min-height values in the Ionic theme. The fix adjusts padding placement and removes fixed min-height constraints when the rows attribute is present.

Changes:

  • Removed hardcoded min-height values from .textarea-size-* classes in the Ionic theme
  • Added min-height: auto override for textareas with the rows attribute
  • Moved padding from .textarea-wrapper-inner to .native-textarea when rows is set (for proper scrolling behavior)
  • Added comprehensive e2e tests for the rows functionality

Reviewed changes

Copilot reviewed 4 out of 91 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
textarea.ionic.scss Removed min-height from size classes; added padding redistribution for rows attribute
textarea.common.scss Added min-height: auto override for textareas with rows attribute
test/rows/textarea.e2e.ts New comprehensive test suite for rows functionality
test/rows/index.html New manual testing page for rows feature
Various snapshot files Updated visual regression test snapshots

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rugoncalves rugoncalves marked this pull request as ready for review February 16, 2026 18:04
@rugoncalves rugoncalves marked this pull request as draft February 16, 2026 18:05
@rugoncalves rugoncalves marked this pull request as ready for review February 16, 2026 18:33
@thetaPC
Copy link
Contributor

thetaPC commented Feb 17, 2026

@rugoncalves for future PRs, please make sure to link the original PR since it is helpful to review feedback left by the reviewers. I've already added the link.

Comment on lines +5 to +6
* Rows attribute is only available in the Ionic theme.
* When set, it increases the container min-height to accommodate the number of rows.
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's be consistent with the other tests:

Suggested change
* Rows attribute is only available in the Ionic theme.
* When set, it increases the container min-height to accommodate the number of rows.
* This behavior does not vary across directions
* This behavior only applies to the `ionic` theme.

*/
configs({ modes: ['ionic-md'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
test.describe(title('textarea: rows'), () => {
test('should respect rows attribute and set min-height', async ({ page }) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
test('should respect rows attribute and set min-height', async ({ page }) => {
test('should respect rows attribute, async ({ page }) => {

Copy link
Contributor

Choose a reason for hiding this comment

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

We don't need to have examples of multiple rows example. Keep it simple:

  • Default (no size) with the row of 3
  • Small with the row of 3
  • Medium with the row of 3
  • Large with the row of 3
  • Default (no size) with the row of 3 and autosize

Copy link
Contributor

Choose a reason for hiding this comment

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

Remove the label-placement attribute since the rows changes is not associated to the label based on the CSS.

Copy link
Contributor

Choose a reason for hiding this comment

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

Remove the helper-text since we don't need to extra indication of how many rows there are since it's being defined in the header.

Comment on lines +142 to +145
:host([rows]:not([auto-grow])) .start-slot-wrapper,
:host([rows]:not([auto-grow])) .end-slot-wrapper {
@include globals.padding(var(--padding-top), 0, var(--padding-bottom), 0);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this needed? There's no example on the test page or in the E2E tests. Add an example to verify that these styles are needed.

await expect(container).toHaveScreenshot(screenshot(`textarea-rows-different-values`));
});

test('should respect rows attribute with fill outline and solid', async ({ page }) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove this test since the change is not dependent to the outline. Make sure to delete the old snapshots too.

);

const container = page.locator('#container');
await expect(container).toHaveScreenshot(screenshot(`textarea-rows-different-sizes`));
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
await expect(container).toHaveScreenshot(screenshot(`textarea-rows-different-sizes`));
await expect(container).toHaveScreenshot(screenshot(`textarea-rows-sizes`));

Make sure to delete the old snapshots too.

await expect(container).toHaveScreenshot(screenshot(`textarea-rows-different-sizes`));
});

test('should respect rows attribute with value content', async ({ page }) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Delete this test since it's the same as the first one. Make sure to delete the old snapshots too.

);

const textarea = page.locator('ion-textarea');
await expect(textarea).toHaveScreenshot(screenshot(`textarea-rows-3-autogrow`));
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
await expect(textarea).toHaveScreenshot(screenshot(`textarea-rows-3-autogrow`));
await expect(textarea).toHaveScreenshot(screenshot(`textarea-rows-autogrow`));

Make sure to delete the old snapshots too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: core @ionic/core package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants