Skip to content

Commit

Permalink
Merge pull request missive#282 from nolanlawson/nolan/issue-219
Browse files Browse the repository at this point in the history
fix: make categories into accessible nav buttons
  • Loading branch information
nolanlawson committed Mar 10, 2019
2 parents b951312 + e77c63b commit 85e2163
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ search: 'Search',
clear: 'Clear', // Accessible label on "clear" button
notfound: 'No Emoji Found',
skintext: 'Choose your default skin tone',
categorieslabel: 'Emoji categories', // Accessible title for the list of categories
categories: {
search: 'Search Results',
recent: 'Frequently Used',
Expand Down
4 changes: 4 additions & 0 deletions css/emoji-mart.css
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
padding: 12px 4px;
overflow: hidden;
transition: color .1s ease-out;
margin: 0;
box-shadow: none;
background: none;
border: none;
}
.emoji-mart-anchor:hover,
.emoji-mart-anchor-selected {
Expand Down
9 changes: 5 additions & 4 deletions src/components/anchors.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default class Anchors extends React.PureComponent {
{ selected } = this.state

return (
<div className="emoji-mart-anchors">
<nav className="emoji-mart-anchors" aria-label={i18n.categorieslabel}>
{categories.map((category, i) => {
var { id, name, anchor } = category,
isSelected = name == selected
Expand All @@ -38,8 +38,9 @@ export default class Anchors extends React.PureComponent {
}

return (
<span
<button
key={id}
aria-label={i18n.categories[id]}
title={i18n.categories[id]}
data-index={i}
onClick={this.handleClick}
Expand All @@ -55,10 +56,10 @@ export default class Anchors extends React.PureComponent {
className="emoji-mart-anchor-bar"
style={{ backgroundColor: color }}
/>
</span>
</button>
)
})}
</div>
</nav>
)
}
}
Expand Down
1 change: 1 addition & 0 deletions src/components/picker/nimble-picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const I18N = {
clear: 'Clear', // Accessible label on "clear" button
notfound: 'No Emoji Found',
skintext: 'Choose your default skin tone',
categorieslabel: 'Emoji categories',
categories: {
search: 'Search Results',
recent: 'Frequently Used',
Expand Down

0 comments on commit 85e2163

Please sign in to comment.