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

feat: add title to clear button Search #11474

Conversation

anhtuan-pham1
Copy link
Contributor

Adding title to clear button in Search Component. The clear button now has the same type of of title that was created in the NumberInput component.

Changed

  • Add title ="Clear" in button element
  • Update test case for clear button

Testing / Reviewing

@anhtuan-pham1 anhtuan-pham1 requested a review from a team as a code owner May 23, 2022 22:33
@netlify
Copy link

netlify bot commented May 23, 2022

Deploy Preview for carbon-components-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit fbbdb9e
🔍 Latest deploy log https://app.netlify.com/sites/carbon-components-react/deploys/62a2276d07d6470008508468
😎 Deploy Preview https://deploy-preview-11474--carbon-components-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented May 23, 2022

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit fbbdb9e
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/62a2276d12b221000838138b
😎 Deploy Preview https://deploy-preview-11474--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@aledavila aledavila requested a review from dakahn May 31, 2022 17:28
Copy link
Contributor

@joshblack joshblack left a comment

Choose a reason for hiding this comment

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

Thanks so much for doing this! Left a quick question, curious what you think 👀

@@ -135,6 +135,7 @@ const Search = React.forwardRef(function Search(
className={clearClasses}
disabled={disabled}
onClick={clearInput}
title="Clear"
Copy link
Contributor

Choose a reason for hiding this comment

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

One idea for this field could be to use closeButtonLabelText which is currently being used to label the <button>.

Suggested change
title="Clear"
title={closeButtonLabelText}

One thing we would want to make sure is that title is configurable (for example, someone could specify an alternate title) given that people could use this component in different situations or would like to localize this text 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @joshblack I have updated the title to title={closeButtonLabelText} and the test cases. Thanks for your recommendation.

@anhtuan-pham1 anhtuan-pham1 requested a review from joshblack June 2, 2022 17:32
@kodiakhq kodiakhq bot merged commit 853cbf9 into carbon-design-system:main Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants