FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat(dropdown): add support for menu item icons by mcoker · Pull Request #2451 · patternfly/patternfly · GitHub

feat(dropdown): add support for menu item icons - #2451

Merged
mattnolting merged 2 commits into
patternfly:masterfrom
mcoker:issue-2450
Nov 19, 2019
Merged

feat(dropdown): add support for menu item icons#2451
mattnolting merged 2 commits into
patternfly:masterfrom
mcoker:issue-2450

Conversation

mcoker commented Nov 18, 2019

Copy link
Copy Markdown
Contributor

fixes #2450

I think changing pf-c-dropdown__menu-item to display: flex would be a breaking change, so I've created a modifier (.pf-m-icon) to add that, then added a new element to support the icon configured the same as the app launcher.

Copy link
Copy Markdown
Collaborator

PatternFly-Next preview: https://patternfly-next-pr-2451.surge.sh

mcarrano left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Looks great. Thanks @mcoker !

mattnolting left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Looks good, left a couple comments.

@@ -63,6 +63,14 @@ import './Dropdown.css'
{{/dropdown}}
```

```hbs title=Menu-item-icons
{{#> dropdown id="dropdown-align-top-expanded" dropdown--IsActionMenu="true" dropdown--IsExpanded="true" dropdown--HasItemIcons="true" dropdown--HasToggleIcon="true"}}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

needs a different id to pass axe testing

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

updated

{{#if dropdown--HasItemIcons}}
{{#> dropdown-menu-item dropdown-menu-item--type="a" dropdown-menu-item--modifier="pf-m-icon" dropdown-menu-item--attribute='href="#"'}}
{{#> dropdown-menu-item-icon}}
<img src="/assets/images/pf-logo-small.svg" alt="">

mattnolting Nov 19, 2019
edited
Loading

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

needs aria-hidden="true" val or alt text

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

from #1916 (comment)

Since you are using <img> elements for these icons, AND since these images are redundant (i.e. the text that follows is considered synonymous with these icons), then having alt="" like you have it here is the correct way to tell assistive technology that this image provides no extra meaning and to ignore it.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Still, doesn't pass axe testing. If @jgiardino ok'd it in the past, I'm good with it.

mattnolting left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM 👍

christiemolloy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM!

mattnolting merged commit 6bd5724 into patternfly:master Nov 19, 2019

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 2.43.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

6 participants


Back | FazBrowse Home | New Git URL