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

Added fix for issue #3867 - TextInput action hover state is incorrect #3894

Closed

Conversation

cs25-esc
Copy link
Contributor

@cs25-esc cs25-esc commented Nov 1, 2023

This fix resolves :

  1. Clear input icon will not be displayed when there is no input in the input box.
  2. No background colour will be displayed for clear input icon.
  3. Clear input icon colour slightly changes on hover (colours suggested by @maximedegreve )
Screen.Recording.2023-10-28.at.12.13.43.PM.mov

@cs25-esc cs25-esc requested review from a team and mperrotti November 1, 2023 10:31
Copy link

changeset-bot bot commented Nov 1, 2023

⚠️ No Changeset found

Latest commit: da333c4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@cs25-esc cs25-esc changed the title Added fix issue #3867 Added fix issue #3867 - TextInput action hover state is incorrect Nov 1, 2023
@cs25-esc cs25-esc changed the title Added fix issue #3867 - TextInput action hover state is incorrect Added fix for issue #3867 - TextInput action hover state is incorrect Nov 1, 2023
@siddharthkp siddharthkp requested review from siddharthkp and removed request for mperrotti November 6, 2023 15:15
@siddharthkp
Copy link
Member

Hi!

After discussing with @maximedegreve, I don't think fixing this just in the stories is the right approach here. We need to think about how we want to address this in the component itself 🤔

We can close this pull request and start with API. Sorry about that!

@cs25-esc
Copy link
Contributor Author

cs25-esc commented Nov 6, 2023

Hi!

After discussing with @maximedegreve, I don't think fixing this just in the stories is the right approach here. We need to think about how we want to address this in the component itself 🤔

We can close this pull request and start with API. Sorry about that!

sure @siddharthkp no problem :)

@siddharthkp siddharthkp closed this Nov 7, 2023
@siddharthkp siddharthkp reopened this Nov 7, 2023
@siddharthkp
Copy link
Member

@cs25-esc, Gave it more thought, I think we can keep this PR!

Summarised the different parts of the problem here: #3867 (comment)

The 2nd point is the only one relevant to this pull request. We should remove changeset and custom styles from the story

@cs25-esc
Copy link
Contributor Author

cs25-esc commented Nov 8, 2023

@cs25-esc, Gave it more thought, I think we can keep this PR!

Summarised the different parts of the problem here: #3867 (comment)

The 2nd point is the only one relevant to this pull request. We should remove changeset and custom styles from the story

Hi @siddharthkp so you mean i can continue to work on this PR ?

@siddharthkp
Copy link
Member

Hi @siddharthkp so you mean i can continue to work on this PR ?

Yes. but, we need to change the scope of this pull request.

From #3867 (comment),

Our trailing action example in storybook doesn't match our own design guidelines. This is incorrect behaviour and could encourage a wrong pattern. It's crucial that the clear button is hidden when the input is empty.

Because we want to show trailing action in the example, what we can do here is add a default value to the input to show the action and then hide it if you remove the text. To make this story even clearer, we can add two text inputs, one with text and one without.

@cs25-esc
Copy link
Contributor Author

cs25-esc commented Nov 8, 2023

Hi @siddharthkp will this be helpful ?

A default value will be there whenever the page loads.

Screen.Recording.2023-11-08.at.9.10.28.PM.mov

@siddharthkp
Copy link
Member

A default value will be there whenever the page loads.

Yep! I think that's the way to do it.

Looking at the video, it's a bit odd that the width of the input changes. Is there a way to make sure that doesn't happen? 🤔

@cs25-esc
Copy link
Contributor Author

cs25-esc commented Nov 9, 2023

A default value will be there whenever the page loads.

Yep! I think that's the way to do it.

Looking at the video, it's a bit odd that the width of the input changes. Is there a way to make sure that doesn't happen? 🤔

yeah it happens due to the clear input icon if

A default value will be there whenever the page loads.

Yep! I think that's the way to do it.

Looking at the video, it's a bit odd that the width of the input changes. Is there a way to make sure that doesn't happen? 🤔

Like this ?

Screen.Recording.2023-11-09.at.12.35.40.PM.mov

@siddharthkp
Copy link
Member

That looks much nicer!

@cs25-esc
Copy link
Contributor Author

cs25-esc commented Nov 9, 2023

That looks much nicer!

Shall i make the changes then ?

@siddharthkp
Copy link
Member

Yes, go for it 👍

@cs25-esc
Copy link
Contributor Author

cs25-esc commented Nov 9, 2023

Yes, go for it 👍

i have a doubt like, i could see components WithTrailingAction and WithTooltipDirection in the same story share same implementation so shall i make changes for both ?

@cs25-esc
Copy link
Contributor Author

cs25-esc commented Nov 9, 2023

Yes, go for it 👍

i have a doubt like, i could see components WithTrailingAction and WithTooltipDirection in the same story share same implementation so shall i make changes for both ?

ideally i need to make changes only for component WithTrailingAction

@siddharthkp
Copy link
Member

i have a doubt like, i could see components WithTrailingAction and WithTooltipDirection in the same story share same implementation so shall i make changes for both ?

Yes please

"@primer/react": patch
---

TextInput.features.stories: Changes made on components 'WithTrailingAction' and 'WithTooltipDirection' which fixes
Copy link
Member

Choose a reason for hiding this comment

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

changesets are added to release notes, so we usually don't usually add stories to them. You can delete this file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure

sx={{
width: '30px',
display: 'flex',
alignItems: 'center',
Copy link
Member

Choose a reason for hiding this comment

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

I would have to come back to you next week to review this approach!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah it says the screenshot comparison fails.

Screenshot 2023-11-14 at 9 19 40 AM

anyway to view the difference or update the existing snapshots accordingly (the way i did the test update for AvatarStack issue)

Copy link
Member

Choose a reason for hiding this comment

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

That's expected because we did make a visual change :)

Added the label to update snapshots, should update in a few minutes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it seems update snapshots label has been removed, anyway to achieve this?

Copy link
Member

Choose a reason for hiding this comment

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

I can add that for you

deleted changeset file since changesets are added to release notes
@siddharthkp siddharthkp mentioned this pull request Nov 23, 2023
@siddharthkp
Copy link
Member

Hi @cs25-esc, I made some tiny changes (moved styles from story to component) to get a review on the visual feedback. Hope that's okay!

Note: The snapshot tests are failing, I will update them after getting a review on the hover colors :)

Copy link
Contributor

Hi! This pull request has been marked as stale because it has been open with no activity for 60 days. You can comment on the pull request or remove the stale label to keep it open. If you do nothing, this pull request will be closed in 7 days.

@github-actions github-actions bot added the Stale label Feb 17, 2024
@github-actions github-actions bot closed this Feb 24, 2024
@siddharthkp siddharthkp reopened this Aug 8, 2024
@siddharthkp siddharthkp requested a review from a team as a code owner August 8, 2024 13:11
@siddharthkp siddharthkp changed the base branch from main to textinput-action-hover-design August 8, 2024 13:12
@siddharthkp siddharthkp closed this Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip changeset This change does not need a changelog Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants