Skip to content

Commit

Permalink
[MA-14]: Ensure all interactive functionality is operable with the ke…
Browse files Browse the repository at this point in the history
…yboard in emoji picker
  • Loading branch information
SaurabhSharma-884 committed Dec 10, 2024
1 parent 3224e0d commit 70c5e7f
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ exports[`components/emoji_picker/EmojiPicker should match snapshot 1`] = `
style="height: 290px;"
>
<div
aria-labelledby="emojiPickerSearch"
class="emoji-picker__container"
role="grid"
>
<div
style="overflow: visible; height: 0px; width: 0px;"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ function EmojiPickerCategoryOrEmojiRow({index, style, data, cursorRowIndex, curs
<div
style={style}
className='emoji-picker__row'
role='row'
>
{row.items.map((emojiColumn) => {
const emoji = emojiColumn.item;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ function EmojiPickerCategoryRow({categoryName, style}: Props) {
<div
className='emoji-picker-items__container'
style={style}
role='row'
>
<div
className='emoji-picker__category-header'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ const EmojiPickerCurrentResults = forwardRef<InfiniteLoader, Props>(({categoryOr
className='emoji-picker__items'
style={{height: EMOJI_CONTAINER_HEIGHT}}
>
<div className='emoji-picker__container'>
<div
className='emoji-picker__container'
role='grid'
aria-labelledby='emojiPickerSearch'
>
<AutoSizer>
{({height, width}) => (
<InfiniteLoader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function EmojiPickerItem({emoji, rowIndex, isSelected, onClick, onMouseOver}: Pr

content = (
<img
alt={'emoji image'}
alt={`${emoji.name.toLocaleLowerCase()} emoji image`}
data-testid={emoji.short_names}
src={imgTrans}
className={`emojisprite emoji-category-${emoji.category} emoji-${emojiUnified}`}
Expand All @@ -74,7 +74,6 @@ function EmojiPickerItem({emoji, rowIndex, isSelected, onClick, onMouseOver}: Pr
emojiName: (emojiName).replace(/_/g, ' '),
},
)}
role='button'
/>
);
} else {
Expand All @@ -89,15 +88,17 @@ function EmojiPickerItem({emoji, rowIndex, isSelected, onClick, onMouseOver}: Pr
}

return (
<div
<button
className={itemClassName}
onClick={handleClick}
onMouseOver={throttledMouseOver}
data-testid='emojiItem'
tabIndex={-1}
type='button'
aria-label={isSystemEmoji(emoji) ? emoji.short_name : emoji.name}
>
<div data-testid='emojiItem'>
{content}
</div>
</div>
{content}
</button>
);
}

Expand Down
2 changes: 2 additions & 0 deletions webapp/channels/src/sass/components/_emoticons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,9 @@ $emoji-footer-height: $emoji-footer-border-width + $emoji-half-height + $emoji-
height: 36px;
align-items: center;
justify-content: center;
border:none;
border-radius: 3px;
background-color: transparent;
cursor: pointer;
vertical-align: middle;

Expand Down

0 comments on commit 70c5e7f

Please sign in to comment.