Skip to content

feat(textarea): remove legacy FormField, Label and Input usage - #8116

Merged
tamas-sage merged 1 commit into
masterfrom
feat/fe-7735-textarea-remove-legacy-label
Sep 10, 2026
Merged

feat(textarea): remove legacy FormField, Label and Input usage#8116
tamas-sage merged 1 commit into
masterfrom
feat/fe-7735-textarea-remove-legacy-label

Conversation

@tamas-sage

@tamas-sage tamas-sage commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Proposed behaviour

Textarea should remove the remaining legacy wrapper dependency and keep the same layout and styling as before.

Current behaviour

Textarea no longer uses legacy FormField, Label, or Input, but it still relies on legacy InputPresentation and has some layout regressions.

Checklist

  • Commits follow our style guide
  • Related issues linked in commit messages if required
  • Screenshots are included in the PR if useful
  • All themes are supported if required
  • Unit tests added or updated if required
  • Playwright automation tests added or updated if required
  • Storybook added or updated if required
  • Translations added or updated (including creating or amending translation keys table in storybook) if required
  • Typescript d.ts file added or updated if required
  • Related docs have been updated if required

QA

  • Tested in provided StackBlitz sandbox/Storybook
  • Add new Playwright test coverage if required
  • Carbon implementation matches Design System/designs
  • UI Tests GitHub check reviewed if required

Additional context

Testing instructions

Test in Storybook:

Open the Textarea stories and verify the component renders correctly across all variants (default, with label, inline label, with character count, with hint text, with validation, error/warning/info).
Confirm focus ring appears correctly on click and keyboard Tab navigation.
Confirm validation messages, character count, and hint text display as expected.
Confirm labelInline layout is correct.
Test inside a Form story to verify the component integrates correctly and validation behaviour is unchanged.
Confirm all themes (mint, sage, carbon, none) render without visual regressions.

@tamas-sage
tamas-sage requested review from a team as code owners August 6, 2026 07:56
@tamas-sage
tamas-sage marked this pull request as draft August 7, 2026 09:32
@tamas-sage tamas-sage self-assigned this Aug 7, 2026
@tamas-sage
tamas-sage force-pushed the feat/fe-7735-textarea-remove-legacy-label branch from 51b24aa to c103077 Compare August 10, 2026 08:51
Comment thread src/components/textarea/textarea.style.ts Outdated
Comment thread src/components/textarea/textarea.component.tsx
Comment thread src/components/textarea/textarea.component.tsx Outdated
Comment thread src/components/textarea/textarea.component.tsx
Comment thread src/components/textarea/textarea.component.tsx

Copilot AI left a comment

Copy link
Copy Markdown

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 completes the migration of Textarea away from legacy FormField, Label, and Input wrappers while preserving existing styling/layout expectations, and updates related stories/tests/docs to reflect the new implementation and corrected textarea event typings.

Changes:

  • Refactors Textarea to render a native <textarea> and custom label container while still using legacy InputPresentation for presentation/states.
  • Updates Jest + Playwright tests and Storybook stories to match new markup/hooks, including label/hint layout and icon padding.
  • Aligns onChange typings and documentation to HTMLTextAreaElement across the component, stories, and skills docs.

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/hooks/use-multi-input/use-multi-input.tsx Broadens change handler typing to support both inputs and textareas.
src/components/tile/tile-test.stories.tsx Fixes textarea onChange typing in a tile story.
src/components/textarea/textarea.test.tsx Updates/extends unit tests for new textarea structure, selectors, and legacy-compat behaviours.
src/components/textarea/textarea.style.ts Reworks styles to target a native textarea and new label container structure.
src/components/textarea/textarea.stories.tsx Updates stories to use textarea-appropriate change event types.
src/components/textarea/textarea.pw.tsx Updates Playwright selectors/assertions for new label container and adaptive label behaviour.
src/components/textarea/textarea.component.tsx Core refactor removing legacy FormField/Label/Input usage and introducing new label container + native textarea.
src/components/textarea/textarea-test.stories.tsx Updates textarea test-story change handler typing.
src/components/textarea/components.test-pw.tsx Updates Playwright component fixtures to use textarea change event types.
src/components/form/form.stories.tsx Updates textarea usage in form story to correct event typing.
src/components/form/form-test.stories.tsx Updates textarea usage in form test story to correct event typing.
src/internal/legacy-input/input.test.tsx Adds/extends tests around legacy input border-radius array + blur behaviour.
src/internal/legacy-input/input-presentation.test.tsx Adds test coverage for focus styling driven by input context.
skills/carbon-react/components/textarea.md Updates generated docs to reflect textarea event typings and updated deprecated-prop descriptions.
skills/carbon-react/components/form.md Updates generated docs snippet to use textarea change event typings.
package-lock.json Lockfile updates from dependency/version resolution changes.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/components/textarea/textarea.component.tsx
Comment thread src/components/textarea/textarea.component.tsx
@tamas-sage
tamas-sage force-pushed the feat/fe-7735-textarea-remove-legacy-label branch from f475b39 to 2ae37e0 Compare August 14, 2026 07:59
Comment thread src/components/textarea/textarea.component.tsx Outdated
Comment thread package-lock.json
DipperTheDan
DipperTheDan previously approved these changes Aug 27, 2026
@tamas-sage
tamas-sage requested a review from ibutakova August 27, 2026 12:18
ibutakova
ibutakova previously approved these changes Aug 27, 2026
@divyajindel
divyajindel marked this pull request as ready for review August 27, 2026 23:03
@divyajindel
divyajindel requested a review from a team as a code owner August 27, 2026 23:03
@tamas-sage
tamas-sage dismissed stale reviews from ibutakova and DipperTheDan via a624565 September 3, 2026 11:08
@tamas-sage
tamas-sage force-pushed the feat/fe-7735-textarea-remove-legacy-label branch from 951c296 to d0d9805 Compare September 7, 2026 14:58
@tamas-sage
tamas-sage requested a review from ibutakova September 8, 2026 09:00
@tamas-sage
tamas-sage force-pushed the feat/fe-7735-textarea-remove-legacy-label branch from 52b54dd to a1dc8e3 Compare September 10, 2026 09:10

@nineteen88 nineteen88 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving skills updates

@tamas-sage
tamas-sage merged commit 3fad37c into master Sep 10, 2026
30 checks passed
@tamas-sage
tamas-sage deleted the feat/fe-7735-textarea-remove-legacy-label branch September 10, 2026 09:39
@carbonci

Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 161.23.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Development

Successfully merging this pull request may close these issues.

8 participants