fix(core): align loading spinner inside TextArea corner (#4232)
Summary
Fixes #4232.
In TextArea's isLoading (busy) state, the loading Spinner was previously rendered without positioning container styles, causing it to fall into normal flow outside the field wrapper or overlap scrollbars.
This PR updates TextArea to anchor the loading spinner inside the top-right corner of the field wrapper using flex alignment, matching the status icon layout without interfering with native vertical scrollbars.
Changes Made
packages/core/src/TextArea/TextArea.tsx:- Wrapped
Spinnerin aspinnerIcon<span>styled as a flex item (alignSelf: 'flex-start',marginInlineStart: spacingVars['--spacing-2']). - Gated status icon rendering (
status && !isBusy) so the busy spinner takes precedence without overlapping validation icons. - Kept
<textarea>in flex flow (flex: 1) so native scrollbars remain contained inside<textarea>and do not overlap the spinner.
- Wrapped
apps/storybook/stories/TextArea.stories.tsx:- Added
isLoadingcontrols and theIsLoadingstory for visual testing.
- Added
packages/core/src/TextArea/TextArea.test.tsx:- Added unit test coverage asserting
isLoadingrenders the positioned spinner container and suppresses status icons.
- Added unit test coverage asserting
Test Plan
- Automated Tests:
- Executed
npx vitest run packages/core/src/TextArea/TextArea.test.tsx(59/59 passed).
- Executed
- Visual Inspection:
- Verified
<TextArea isLoading />in Storybook (http://localhost:6006/?path=/story/textarea--is-loading). - Verified spinner remains anchored inside the top-right corner without overlapping vertical scrollbars when text overflows.
- Verified
The latest updates on your projects. Learn more about Vercel for GitHub.
| Project | Deployment | Actions | Updated (UTC) |
|---|---|---|---|
| Aug 2, 2026 7:26pm |
PR Analysis Report
Modified Components
Field
| Metric | Before | After | Delta |
|---|---|---|---|
| Bundle Size (ESM) | N/A | N/A | N/A |
| Lines of Code | N/A | 505 | - |
| Complexity | N/A | Very High (31) | - |
TextArea
| Metric | Before | After | Delta |
|---|---|---|---|
| Bundle Size (ESM) | N/A | N/A | N/A |
| Lines of Code | N/A | 357 | - |
| Complexity | N/A | Very High (45) | - |
Bundle Size Summary
| Package | Size (ESM) | Size (CJS) | Gzipped |
|---|---|---|---|
| @astryxdesign/core | N/A | 4.7KB | 0B |
Accessibility Audit
Status: 1 accessibility violation(s) found — 1 serious.
TextArea - 1 issue(s)
- 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
- Rule:
color-contrast· Affects 1/26 stories · Learn more - WCAG: 1.4.3 (Level AA)
- Rule:
Generated by PR Enrichment workflow | View full report
yep imma make the changes, thanks!
so like should i make the changes or will this get merged? i am kinda confused sorry
Thanks @cixzhang! I've updated the PR to pass xstyle={styles.spinnerIcon} directly to
Hello, @cixzhang I was wondering if looking at this fix is on the list or did it become obsolete, im sorry to interrupt but its been quite a while, so thought of writing this up