Skip to content

Conversation

@lemagnetic
Copy link
Contributor

@lemagnetic lemagnetic commented Oct 23, 2025

What's the purpose of this pull request?

This PR fixes a visual bug in the TextareaField component where long text would appear underneath the floating label during scroll, making it difficult to read. The issue was identified during the review of PR #2705.

Additionally, comprehensive Storybook documentation was added to showcase all TextareaField variations and use cases.

Gravacao.de.Tela.2025-10-23.as.19.17.16.mov

How it works?

Bug Fix:

  • Added --fs-textarea-field-label-background-color CSS variable to packages/ui/src/components/molecules/TextareaField/styles.scss
  • Set default value to neutral-0 (white) to prevent text from showing through the label
  • When the textarea content is long and the user scrolls, the label now has an opaque background, preventing text overlap

How to test it?

Test the scroll bug fix:

From the project root:

pnpm --filter "@faststore/storybook" dev

Or navigate to the storybook package:

cd packages/storybook
pnpm dev

Then:

  1. Open http://localhost:6006 in your browser
  2. Navigate to "TextareaField""LargeText" story
  3. Scroll inside the textarea content
  4. Verify that the text no longer appears underneath the label

References

@lemagnetic lemagnetic requested a review from a team as a code owner October 23, 2025 01:14
@lemagnetic lemagnetic added the bug Something isn't working label Oct 23, 2025
@lemagnetic lemagnetic requested review from eduardoformiga and gabpaladino and removed request for a team October 23, 2025 01:14
@codesandbox-ci
Copy link

codesandbox-ci bot commented Oct 23, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

- Adjust padding and positioning variables for better alignment
- Fix label position on focus and filled states
- Add width calculation to prevent label overflow
@matheusps matheusps changed the base branch from main to dev October 27, 2025 16:05
Copy link
Contributor

@lucasfp13 lucasfp13 left a comment

Choose a reason for hiding this comment

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

Nice, creating testing stories too 🚀
Just a reminder to resolve the conflicts 🎗️

Copy link
Contributor

@lariciamota lariciamota left a comment

Choose a reason for hiding this comment

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

suggestion: the disabled state gets weird with the white background, what do you think about changing the label's bkg color also when the textarea is disabled?
Screenshot 2025-10-29 at 15 42 59

@lemagnetic
Copy link
Contributor Author

suggestion: the disabled state gets weird with the white background, what do you think about changing the label's bkg color also when the textarea is disabled? Screenshot 2025-10-29 at 15 42 59

Thanks for the feedback!
Fixed it here: 9423d79

@matheusps matheusps merged commit 9e5a64d into dev Oct 30, 2025
4 of 5 checks passed
@matheusps matheusps deleted the fix/textarea-field-label branch October 30, 2025 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants