emoji-picker-react icon indicating copy to clipboard operation
emoji-picker-react copied to clipboard

Accessible names of icons

Open Dominiczeq7 opened this issue 1 year ago • 2 comments

There is need to have better aria-labels for some icons like flags. For example aria-label="flag-pl" is not very accessible.

Dominiczeq7 avatar Dec 14 '23 10:12 Dominiczeq7

Hm. Not sure how to handle this. Emoji names are provided by the js-emoji library. An option would be to just use all names in the label, but that might be a little bit excessive.

ealush avatar Dec 22 '23 23:12 ealush

@ealush I have idea how to handle this. Let's look at ClickableEmojiButton.tsx. We have:

      aria-label={emojiNames[0]}
      data-full-name={emojiNames}

We can change to this:

      aria-label={emojiNames[0].match('flag-') ? emojiNames[1] : emojiNames[0]}
      data-full-name={emojiNames}

Because in data-full-name there is list of two values and we can catch case when flag name is used and use the second one. image

Can I make PR to push this change?

DGG-IVY avatar Jan 16 '24 15:01 DGG-IVY

@ealush Can you merge this please? https://github.com/ealush/emoji-picker-react/pull/393

BTW. @DGG-IVY is my second account - I forgot to relogin

Dominiczeq7 avatar Feb 29 '24 09:02 Dominiczeq7