Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STCOM-1240 Added support for clear icon in TextArea #2181

Merged
merged 8 commits into from
Jan 9, 2024
Merged

Conversation

BogdanDenis
Copy link
Contributor

@BogdanDenis BogdanDenis commented Dec 8, 2023

Description

Added support for clear icon in <TextArea>
Checked the component in multiple apps and changes in component structure don't seem to affect visuals

Screenshots

image
image
image
image

Issues

STCOM-1240

Related PRs

folio-org/stripes-testing#2648

@BogdanDenis BogdanDenis requested review from JohnC-80, Dmytro-Melnyshyn and a team December 8, 2023 17:00
Copy link

github-actions bot commented Dec 8, 2023

Jest Unit Test Statistics

0 tests  ±0   0 ✔️ ±0   0s ⏱️ ±0s
0 suites ±0   0 💤 ±0 
0 files   ±0   0 ±0 

Results for commit 6e6e1ed. ± Comparison against base commit c984830.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Dec 8, 2023

BigTest Unit Test Statistics

       1 files  ±0         1 suites  ±0   11s ⏱️ ±0s
1 418 tests +2  1 397 ✔️ +2  21 💤 ±0  0 ±0 
1 421 runs  +2  1 400 ✔️ +2  21 💤 ±0  0 ±0 

Results for commit 6e6e1ed. ± Comparison against base commit c984830.

♻️ This comment has been updated with latest results.

@BogdanDenis BogdanDenis marked this pull request as ready for review December 8, 2023 17:06
JohnC-80

This comment was marked as outdated.

Copy link
Contributor

@JohnC-80 JohnC-80 left a comment

Choose a reason for hiding this comment

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

I do wish this had a more refined design/behavior to it. If the Textarea is horizontally resized, the close icon doesn't quite follow along. Things aren't quite set up where the clear x avoids overflowing the text. Is this feature immediately needed?

textarea

@BogdanDenis
Copy link
Contributor Author

Good catch, @JohnC-80, I added another commit to handle resizing:

chrome_Of4UOmy7Vk.mp4

@BogdanDenis BogdanDenis requested a review from JohnC-80 December 13, 2023 10:05
@Dmitriy-Litvinenko
Copy link
Contributor

Hello @JohnC-80 Could you please re-review @BogdanDenis already fixed last feedback?

Copy link
Contributor

@JohnC-80 JohnC-80 left a comment

Choose a reason for hiding this comment

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

Apologies for delay in feedback here. ResizeObserver seems like a great way to handle this, but it looks like there does need to be some statefulness to this or perhaps more attention to positioning the element when it does appear. Attaching a gif that shows 2 issues - When I focus away from the text area, the clear Icon shifts back to its original position.
The gif also shows what happens when I switch to RTL direction.
textarea_interaction

@BogdanDenis
Copy link
Contributor Author

Hey @JohnC-80, I added some changes to support RTL and fix positioning when losing focus

chrome_4xsJ3GsLEP.mp4

@BogdanDenis BogdanDenis requested a review from JohnC-80 January 3, 2024 14:45
Copy link

sonarqubecloud bot commented Jan 9, 2024

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

2 New issues
0 Security Hotspots
95.4% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

@BogdanDenis BogdanDenis merged commit 6ea7862 into master Jan 9, 2024
6 checks passed
@BogdanDenis BogdanDenis deleted the STCOM-1240 branch January 9, 2024 15:47
github-actions bot pushed a commit that referenced this pull request Jan 9, 2024
* STCOM-1240 Added support for clear icon in TextArea

* STCOM-1240 Handle resize of TextArea

* STCOM-1240 Fix TextArea end controls position with rtl and when losing focus
zburke added a commit to folio-org/ui-users that referenced this pull request Feb 20, 2024
stripes-components leverages `window.ResizeObserver` since STCOM-1240
(/folio-org/stripes-components/pull/2181), which is not present on JSDom
and therefore must be mocked.

Refs UIU-3066, STCOM-1240
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.

5 participants