Skip to content

feat(pie-textarea): DSW-3906 Textarea Uncontrolled Usage - #3092

Open
KatarinaNeskovic wants to merge 6 commits into
mainfrom
dsw-3906-textarea-uncontrolled-usage
Open

feat(pie-textarea): DSW-3906 Textarea Uncontrolled Usage#3092
KatarinaNeskovic wants to merge 6 commits into
mainfrom
dsw-3906-textarea-uncontrolled-usage

Conversation

@KatarinaNeskovic

@KatarinaNeskovic KatarinaNeskovic commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Describe your changes (can list changeset entries if preferable)

Fixes gaps in to align with native <textarea> controlled and uncontrolled behavior. Previously, value was strictly required, defaultValue was only applied on form reset and ignored on first render if value wasn't passed, causing empty component to load.

This PR changes make value optional, ensure proper seeding of defaultValue on component load and correct fallback on form reset.

image

Acceptance Criteria:

  • Value prop is optional
  • The desired behaviour demonstrated in the table is applied
  • Tests and docs are updated
  • Update uncontrolled form aperture examples and tests to ensure the above behaviour.

Changes were tested in Aperture and Aperture PR is here.

Author Checklist (complete before requesting a review, do not delete any)

  • I have performed a self-review of my code.
  • I have added thorough tests where applicable (unit / component / visual).
  • I have reviewed the PIE Storybook/PIE Docs PR preview.
  • I have reviewed visual test updates properly before approving.
  • If changes will affect consumers of the package, I have created a changeset entry.
  • If a changeset file has been created, I have tested these changes in PIE Aperture using the /test-aperture command.

Not-applicable Checklist items

Please move any Author checklist items that do not apply to this pull request here.


Reviewer checklists (complete before approving)

Mark items as [-] N/A if not applicable.

Reviewer 1

  • I have reviewed the PIE Storybook/PIE Docs PR preview.
  • I have verified that all acceptance criteria for this ticket have been completed.
  • I have reviewed the Aperture changes (if added)
  • If there are visual test updates, I have reviewed them.

Reviewer 2

  • I have reviewed the PIE Storybook/PIE Docs PR preview.
  • I have verified that all acceptance criteria for this ticket have been completed.
  • I have reviewed the Aperture changes (if added)
  • If there are visual test updates, I have reviewed them.

@changeset-bot

changeset-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ae844f7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@justeattakeaway/pie-textarea Minor
@justeattakeaway/pie-storybook Minor
@justeattakeaway/pie-webc Patch
@justeattakeaway/pie-docs Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@KatarinaNeskovic
KatarinaNeskovic force-pushed the dsw-3906-textarea-uncontrolled-usage branch from 5f79e82 to f465821 Compare August 4, 2026 15:38
@KatarinaNeskovic KatarinaNeskovic changed the title Dsw 3906 textarea uncontrolled usage feat(pie-textarea): DSW-3906 Textarea Uncontrolled Usage Aug 4, 2026
@pie-design-system-app
pie-design-system-app Bot temporarily deployed to storybook-testing-pr-3092 August 4, 2026 15:49 Inactive
@KatarinaNeskovic

Copy link
Copy Markdown
Contributor Author

/test-aperture

@pie-design-system-app

Copy link
Copy Markdown
Contributor

Starting a new snapshot build. You can view the logs here.

@pie-design-system-app

Copy link
Copy Markdown
Contributor

The build failed, please see the logs or take a look at the Workflow Tooling wiki page to make sure your PR meets the requirements.

@pie-design-system-app

Copy link
Copy Markdown
Contributor

Starting a new snapshot build. You can view the logs here.

@pie-design-system-app

Copy link
Copy Markdown
Contributor

An unexpected error occurred during the snapshot release process:

No changed packages found! Please make sure you have added a changeset entry for the packages you would like to snapshot.

@KatarinaNeskovic

Copy link
Copy Markdown
Contributor Author

/snapit

@pie-design-system-app

Copy link
Copy Markdown
Contributor

Starting a new snapshot build. You can view the logs here.

@pie-design-system-app
pie-design-system-app Bot temporarily deployed to storybook-testing-pr-3092 August 4, 2026 16:20 Inactive
@pie-design-system-app

Copy link
Copy Markdown
Contributor

@KatarinaNeskovic Your snapshots have been published to npm!

Test the snapshots by updating your package.json with the newly-published versions:

Note

If you have more than one of these packages installed, we suggest using the new snapshots for all of them to help avoid version conflicts.

yarn up @justeattakeaway/pie-textarea@0.0.0-snapshot-release-20260804162046 --mode=update-lockfile
yarn up @justeattakeaway/pie-webc@0.0.0-snapshot-release-20260804162046 --mode=update-lockfile

Then finally:

yarn install

@pie-design-system-app

Copy link
Copy Markdown
Contributor

🚀 Aperture PR created: justeattakeaway/pie-aperture#549

App deployments will appear under the Deployments section of this PR shortly!

Updated 4 Aug 2026, 16:23 UTC · PIE @ dc3b7b7 · workflow run

@KatarinaNeskovic

Copy link
Copy Markdown
Contributor Author

/snapit

@pie-design-system-app

Copy link
Copy Markdown
Contributor

Starting a new snapshot build. You can view the logs here.

@pie-design-system-app

Copy link
Copy Markdown
Contributor

@KatarinaNeskovic Your snapshots have been published to npm!

Test the snapshots by updating your package.json with the newly-published versions:

Note

If you have more than one of these packages installed, we suggest using the new snapshots for all of them to help avoid version conflicts.

yarn up @justeattakeaway/pie-textarea@0.0.0-snapshot-release-20260807093459 --mode=update-lockfile
yarn up @justeattakeaway/pie-webc@0.0.0-snapshot-release-20260807093459 --mode=update-lockfile

Then finally:

yarn install

@KatarinaNeskovic
KatarinaNeskovic marked this pull request as ready for review August 7, 2026 10:40
@KatarinaNeskovic
KatarinaNeskovic requested a review from a team as a code owner August 7, 2026 10:40
@KatarinaNeskovic KatarinaNeskovic self-assigned this Aug 7, 2026
@pie-design-system-app
pie-design-system-app Bot temporarily deployed to storybook-testing-pr-3092 August 7, 2026 10:45 Inactive
Comment thread packages/components/pie-textarea/src/index.ts Outdated
Comment thread packages/components/pie-textarea/src/index.ts Outdated
public formResetCallback (): void {
this.value = this.defaultValue ?? defaultProps.value;

this.value = this.defaultValue ?? '';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

do you think we can keep defaultProps.value but not assign it to the prop declaration on public value: TextareaProps['value']; as i see it's being used multiple times

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hey @raoufswe I understand you'd want to avoid hardcoding, but I think in this context leaving the empty string is self explanatory and appears only in few places. I am just thinking it may be misleading to provide default to the value prop in defs.ts, if we want to purposefully keep it undefined to support uncontrolled usage. If you still think it's better practice, I totally trust your judgment - I'm happy to leave a comment to explain this is not a default for the prop :) Let me know!

@KatarinaNeskovic
KatarinaNeskovic force-pushed the dsw-3906-textarea-uncontrolled-usage branch from 47aab10 to 629fef0 Compare August 11, 2026 15:06
@pie-design-system-app
pie-design-system-app Bot temporarily deployed to storybook-testing-pr-3092 August 11, 2026 15:13 Inactive
@KatarinaNeskovic

Copy link
Copy Markdown
Contributor Author

/snapit

@pie-design-system-app

Copy link
Copy Markdown
Contributor

Starting a new snapshot build. You can view the logs here.

@pie-design-system-app

Copy link
Copy Markdown
Contributor

@KatarinaNeskovic Your snapshots have been published to npm!

Test the snapshots by updating your package.json with the newly-published versions:

Note

If you have more than one of these packages installed, we suggest using the new snapshots for all of them to help avoid version conflicts.

yarn up @justeattakeaway/pie-textarea@0.0.0-snapshot-release-20260811151859 --mode=update-lockfile
yarn up @justeattakeaway/pie-webc@0.0.0-snapshot-release-20260811151859 --mode=update-lockfile

Then finally:

yarn install

@pie-design-system-app

Copy link
Copy Markdown
Contributor



Fails
🚫 You have unchecked checklist items outside the "Not-applicable Checklist items" section.

Please ensure all unchecked checkboxes are moved to the appropriate section.

🚫 You have unchecked checklist items in Reviewer 1's section.

Please ensure all items are addressed before approval.

🚫 You have unchecked checklist items in Reviewer 2's section.

Please ensure all items are addressed before approval.

Generated by 🚫 dangerJS against ae844f7

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