From 6417fbb8ca604ce70445939ec21dfdea20e51b99 Mon Sep 17 00:00:00 2001 From: Daniel Macak Date: Tue, 2 Jul 2024 12:46:52 +0200 Subject: [PATCH] fix: don't anticipate i18n a11y object will be present I forgot users can provide their own i18n, in which case it can come to TypeErrors. So I shouldn't count on the a11y always being there. Relates to PS-21279. --- packages/emoji-mart/src/components/Picker/Picker.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/emoji-mart/src/components/Picker/Picker.tsx b/packages/emoji-mart/src/components/Picker/Picker.tsx index 06dae9db..8f33f809 100644 --- a/packages/emoji-mart/src/components/Picker/Picker.tsx +++ b/packages/emoji-mart/src/components/Picker/Picker.tsx @@ -1180,7 +1180,7 @@ export default class Picker extends Component { width: this.props.dynamicWidth ? '100%' : lineWidth, height: '100%', }} - aria-label={I18n.a11y.available_emojis ?? 'Available emojis'} + aria-label={I18n.a11y?.available_emojis ?? 'Available emojis'} > {this.props.searchPosition == 'static' && this.renderSearch()} {this.renderSearchResults()}