Skip to content

Commit

Permalink
fix(emoji-picker): add no result to aria region
Browse files Browse the repository at this point in the history
  • Loading branch information
Catalin committed Aug 5, 2024
1 parent b6466ff commit 9d2189a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/emoji-mart/src/components/Picker/Picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,14 @@ export default class Picker extends Component {

renderLiveRegion() {
const emoji = this.getEmojiByPos(this.state.pos)
const contents = emoji ? emoji.name : ''
const noSearchResults =
this.state.searchResults && !this.state.searchResults.length

let contents = emoji
? emoji.name
: noSearchResults
? I18n.search_no_results_2
: ''

return (
<div aria-live="polite" class="sr-only">
Expand Down

0 comments on commit 9d2189a

Please sign in to comment.