carbon icon indicating copy to clipboard operation
carbon copied to clipboard

fix: 15752 invalid tooltip on hovering the select component

Open mHuzefa opened this issue 1 year ago • 5 comments

Closes #15752

Fixed the invalid title/no title in Select component on hovering

New

  • selectDefaultTitle which gets select element by it's id. if defaultValue is passed, it gets the option with defaultValue from select, otherwise get option by using the selectedIndex

Changed

  • To show the valid tooltip replaced select value with option's text by using selectedIndex in select.options
  • To show default option's text in title executed the selectDefaultTitle in useEffect
  • Added a new test case which is 'should show SelectItem text as title' which renders Select with defaultValue 'Option 2', expected result should be the title 'Option 2'

Testing / Reviewing

  • Hover on Select component, it should show the selected Option as tooltip
  • If there's no option selected, tooltip should not show

mHuzefa avatar Feb 20 '24 17:02 mHuzefa

DCO Assistant Lite bot All contributors have signed the DCO.

github-actions[bot] avatar Feb 20 '24 17:02 github-actions[bot]

I have read the DCO document and I hereby sign the DCO.

mHuzefa avatar Feb 20 '24 18:02 mHuzefa

recheck

mHuzefa avatar Feb 20 '24 18:02 mHuzefa

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
Latest commit 397ac8987e98aaced25eaf22ff55abf5e4d91aa3
Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/65eb17f925a73e000844d9b3
Deploy Preview https://deploy-preview-15788--v11-carbon-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 configuration.

netlify[bot] avatar Feb 20 '24 19:02 netlify[bot]

@alisonjoseph and @guidari, PR is ready for review. Thanks 😊

mHuzefa avatar Feb 21 '24 07:02 mHuzefa

@mHuzefa Hii :) thank you for contributing, is there a way you can fix the merge conflicts? Thank you!

andreancardona avatar Feb 26 '24 19:02 andreancardona

@guidari Have changed the values to match what you suggested.

@andreancardona I have resolved the merged conflicts although I am sorry that I forgot to rebase my main with upstream and all commits came in this branch so I had to forced push to rewrite the changes. That's why it added other reviewers too.

mHuzefa avatar Feb 27 '24 12:02 mHuzefa