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

fix(menu): drill-in disabled menu item chevron #2199

Merged
merged 1 commit into from
Oct 13, 2023

Conversation

jawinn
Copy link
Collaborator

@jawinn jawinn commented Oct 3, 2023

Description

A drill-in set to "open" was no longer showing the disabled color for the chevron icon. Moves disabled CSS after other CSS, which resolves this issue.

Also adds this case in the existing Storybook example for drill-in.

Fixes #2176

How and where has this been tested?

Please tag yourself on the tests you've marked complete to confirm the tests have been run by someone other than the author.

Validation Steps

Regression testing

Validate:

  1. A legacy documentation page (such as accordion), including:
  • The page renders correctly
  • The page is accessible
  • The page is responsive
  1. A migrated documentation page (such as action group), including:
  • The page renders correctly
  • The page is accessible
  • The page is responsive

Screenshots

To-do list

  • I have read the contribution guidelines.

  • I have updated relevant storybook stories and templates.

  • I have tested these changes in Windows High Contrast mode.

  • If my change impacts other components, I have tested to make sure they don't break.

  • If my change impacts documentation, I have updated the documentation accordingly.

  • ✨ This pull request is ready to merge. ✨

@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2023

🚀 Deployed on https://pr-2199--spectrum-css.netlify.app

@github-actions github-actions bot temporarily deployed to pull request October 3, 2023 21:33 Inactive
@mdt2 mdt2 self-requested a review October 5, 2023 14:19
Copy link
Collaborator

@mdt2 mdt2 left a comment

Choose a reason for hiding this comment

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

LGTM 👏

Copy link
Collaborator

@pfulton pfulton left a comment

Choose a reason for hiding this comment

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

Ship it!

@@ -342,7 +342,12 @@ DrillInSubmenu.args = {
isDrillIn: true,
isOpen: true,
},
{ label: "Select and Mask..." },
{
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for adding this!

A drill-in set to "open" was no longer showing the disabled color for
the chevron icon. Moves disabled CSS after other CSS, which resolves
this issue.

Also includes this in the existing Storybook example for drill-in.

Fixes #2176
@pfulton pfulton force-pushed the jawinn/css-594-fix-disabled-menu-item branch from d7a5fc6 to d015a16 Compare October 13, 2023 18:05
@pfulton pfulton added the run_vrt For use on PRs looking to kick off VRT label Oct 13, 2023
@github-actions github-actions bot temporarily deployed to pull request October 13, 2023 18:11 Inactive
@github-actions github-actions bot removed the run_vrt For use on PRs looking to kick off VRT label Oct 13, 2023
@pfulton pfulton merged commit 2dba5d9 into main Oct 13, 2023
7 checks passed
@pfulton pfulton deleted the jawinn/css-594-fix-disabled-menu-item branch October 13, 2023 18:17
&:hover {
cursor: default;

.spectrum-Menu-itemIcon {

Choose a reason for hiding this comment

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

Hi, sorry to revive this issue, but this implementation doesn't work with our API in SWC. The chevron is implemented differently than the other icons that can be slotted into the menu item, so I think the class .spectrum-Menu-chevron would need specification for being disabled, as well, in order to receive styling. Please look here to see the difference between an icon and the chevron. The icon has disabled styling, but the chevron still doesn't.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I took a look at this and tested out added CSS with this draft PR https://github.com/adobe/spectrum-css/pull/2550/files#diff-3b8d6209262a97e225fba580d5a675267ced29e23aadabdcc2cb73332bf11d94 , but in looking at it further I'm not sure if this extra selector is something we should add on our end? Your thoughts @pfulton ? SWC seems to have diverged from how we use our CSS. On our end, the .spectrum-Menu-itemIcon class is a generic one applied to ALL menu item icons, including the workflow icon, the collapsible chevron, the drill-in chevron, and the checkmark. Can SWC also apply this class or these styles to all icons?

Copy link
Contributor

Choose a reason for hiding this comment

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

We can't apply that class, but we can make apply CSS as is appropriate to our context if it doesn't work for CSS to apply this rule here. Ensuring the "system icons" and "consumer icons" are both covered by this styling works a bit different in our world, for sure.

Separately, I'm never sure if I'm working from latest in the CSS public documentations, but can you apply is-disabled to one of the Menu Items in this story?
image
We'd love to see CSS applying the disabled text color to that "value" content as well, here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Separately, I'm never sure if I'm working from latest in the CSS public documentations, but can you apply is-disabled to one of the Menu Items in this story? We'd love to see CSS applying the disabled text color to that "value" content as well, here.

In PR #2579 I've updated the Storybook templates with that increased coverage and have added CSS for the "value" text to use the disabled content color.

@najikahalsema
Copy link

Hi, while you're doing this work for the chevron, could you also add styling for a disabled .spectrum-Menu-itemValue? An issue was filed in our repo here.

@jawinn
Copy link
Collaborator Author

jawinn commented Mar 4, 2024

Hi, while you're doing this work for the chevron, could you also add styling for a disabled .spectrum-Menu-itemValue? An issue was filed in our repo here.

I've fixed that in PR #2579

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.

[Menu][Submenu]: Disabled menu item with submenu does not display correct visuals
5 participants