Skip to content

fix(TextArea): correct value type in onChange/onInput callback data - #4542

Open
Khushighosh wants to merge 1 commit into
Semantic-Org:masterfrom
Khushighosh:fix/strict-textarea-props-type
Open

fix(TextArea): correct value type in onChange/onInput callback data#4542
Khushighosh wants to merge 1 commit into
Semantic-Org:masterfrom
Khushighosh:fix/strict-textarea-props-type

Conversation

@Khushighosh

Copy link
Copy Markdown

Fixes #4464

The onChange/onInput callbacks for TextArea were typed with data: TextAreaProps, which allows value to be number | string | undefined — reflecting valid input values. But at runtime, the callback always returns the actual typed string, so this made consumers cast/narrow data.value unnecessarily.

This PR introduces a TextAreaOnChangeData type that narrows value to string specifically for the callback's returned data, without changing StrictTextAreaProps.value itself.

@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown

@Khushighosh is attempting to deploy a commit to the Semantic UI Team on Vercel.

A member of the Team first needs to authorize it.

@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.53%. Comparing base (e0a42b5) to head (027ccdd).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4542   +/-   ##
=======================================
  Coverage   99.53%   99.53%           
=======================================
  Files         186      186           
  Lines        3463     3463           
=======================================
  Hits         3447     3447           
  Misses         16       16           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

StrictTextAreaProps has a type that includes number and undefined for the "value" field

1 participant