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

style(datatable): isolate row hover styles from Toggletip links #16918

Merged

Conversation

cuppajoey
Copy link
Contributor

@cuppajoey cuppajoey commented Jul 5, 2024

#15965 attempted to prevent table row hover states from affecting links within nested Toggletips; however, the solution was incomplete and caused a style regression.

❌ Before

Toggletip-hover-before.mov

As demonstrated above:

  • When a Toggletip is adjacent to a link, the intended hover styles are no longer applied to the link (i.e., the link color does not change when the row is hovered on).
  • When a Toggletip is in an adjacent cell, the row hover state works, but it affects the Toggletip's link.

📝 Changelog

Changed

  • Modify CSS selector to only change a link's color when it is a child of a table cell but not within a Toggletip.

✅ After

Toggletip-hover-after.mov

🧪 Testing / Reviewing

  • Checkout and build branch
  • Add this modified DataTable storybook example: carbon-datatable-toggletip-story.js
  • Run storybook
  • Open the modified test case ("Test with Tooltips" if you use copied my Gist)
  • Hover over each table row and confirm the link styles are correct.

Changes:
- Improve CSS selector which modifies inline links when their
  parent row is hovered over. Isolate the color change from
  affecting links within an adjacent cell's toggletip.
@cuppajoey cuppajoey requested a review from a team as a code owner July 5, 2024 21:28
Copy link

netlify bot commented Jul 5, 2024

Deploy Preview for v11-carbon-react ready!

Name Link
🔨 Latest commit badb488
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/66cf3789a784f40009e34748
😎 Deploy Preview https://deploy-preview-16918--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.

Copy link

netlify bot commented Jul 5, 2024

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit badb488
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/66cf3789d29f7b00082e41c1
😎 Deploy Preview https://deploy-preview-16918--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 configuration.

@riddhybansal
Copy link
Contributor

Hey can you create a test story, so that we can test in deploy that can be removed once we approve.

@cuppajoey
Copy link
Contributor Author

Hey can you create a test story, so that we can test in deploy that can be removed once we approve.

@riddhybansal I've added a test story which you can find under DataTable → Basic → Test with Tooltips

Copy link
Member

@tay1orjones tay1orjones left a comment

Choose a reason for hiding this comment

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

Thanks for doing this! LGTM once the test story is removed.

@cuppajoey
Copy link
Contributor Author

Thanks for doing this! LGTM once the test story is removed.

My pleasure! I'll wait until the final review is finished then I'll remove the test story.

Copy link
Member

@alisonjoseph alisonjoseph left a comment

Choose a reason for hiding this comment

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

LGTM! Will merge after you remove test story

@cuppajoey
Copy link
Contributor Author

LGTM! Will merge after you remove test story

Test story is removed ✅

@tay1orjones tay1orjones enabled auto-merge August 16, 2024 20:08
@tay1orjones tay1orjones added this pull request to the merge queue Aug 19, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 19, 2024
@tay1orjones tay1orjones enabled auto-merge August 28, 2024 14:43
@tay1orjones tay1orjones added this pull request to the merge queue Aug 28, 2024
Merged via the queue into carbon-design-system:main with commit 67d255d Aug 28, 2024
23 checks passed
@carbon-automation
Copy link
Contributor

Hey there! v11.65.0 was just released that references this issue/PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants