From 57fa8d0436aae21c2b34bfe5830fbdd23ea8f4e0 Mon Sep 17 00:00:00 2001 From: Scott Cooper Date: Fri, 15 Mar 2019 09:43:16 -0700 Subject: [PATCH] feat: improve a11y of emoji list see emoji-mart #284 --- src/lib/emoji/emoji.component.ts | 11 +++++++++-- src/lib/picker/picker.component.html | 4 ++-- src/lib/picker/picker.component.ts | 1 + src/lib/picker/picker.css | 5 +++++ 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/lib/emoji/emoji.component.ts b/src/lib/emoji/emoji.component.ts index 3fafc281..1facb936 100644 --- a/src/lib/emoji/emoji.component.ts +++ b/src/lib/emoji/emoji.component.ts @@ -42,11 +42,12 @@ export interface EmojiEvent { @Component({ selector: 'ngx-emoji', template: ` - @@ -54,7 +55,7 @@ export interface EmojiEvent { {{ unified }} - + `, changeDetection: ChangeDetectionStrategy.OnPush, preserveWhitespaces: false, @@ -79,6 +80,7 @@ export class EmojiComponent implements OnChanges, Emoji { @Output() emojiClick: Emoji['emojiClick'] = new EventEmitter(); style: any; title = ''; + label = ''; unified?: string | null; custom = false; isVisible = true; @@ -110,6 +112,11 @@ export class EmojiComponent implements OnChanges, Emoji { return (this.isVisible = false); } + this.label = [data.native] + .concat(data.shortNames) + .filter(Boolean) + .join(', '); + if (this.isNative && data.unified && data.native) { // hide older emoji before the split into gendered emoji this.style = { fontSize: `${this.size}px` }; diff --git a/src/lib/picker/picker.component.html b/src/lib/picker/picker.component.html index c93b7f52..dfd6353a 100644 --- a/src/lib/picker/picker.component.html +++ b/src/lib/picker/picker.component.html @@ -23,7 +23,7 @@ [icons]="searchIcons" [emojisToShowFilter]="emojisToShowFilter" > -
+
-
+