Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(native): add accessibility labels to poll results and create options (#18078)

Muskan Kumari3ef6390ea584
diff --git a/react/features/polls/components/native/PollCreate.tsx b/react/features/polls/components/native/PollCreate.tsx
index 592905c6e5..11b1ccdc4e 100644
--- a/react/features/polls/components/native/PollCreate.tsx
+++ b/react/features/polls/components/native/PollCreate.tsx
@@ -93,6 +93,7 @@ const PollCreate = (props: AbstractProps) => {
/* eslint-disable react/no-multi-comp */
const createRemoveOptionButton = (onPress: () => void) => (
<Button
+ accessibilityLabel = 'polls.create.removeOption'
id = { t('polls.create.removeOption') }
labelKey = 'polls.create.removeOption'
labelStyle = { dialogStyles.optionRemoveButtonText }
diff --git a/react/features/polls/components/native/PollResults.tsx b/react/features/polls/components/native/PollResults.tsx
index f141147e90..053c336829 100644
--- a/react/features/polls/components/native/PollResults.tsx
+++ b/react/features/polls/components/native/PollResults.tsx
@@ -92,6 +92,13 @@ const PollResults = (props: AbstractProps) => {
}, [ showDetails ]);
+ const detailsLabelKey = showDetails
+ ? 'polls.results.hideDetailedResults'
+ : 'polls.results.showDetailedResults';
+ const voteLabelKey = haveVoted
+ ? 'polls.results.changeVote'
+ : 'polls.results.vote';
+
/* eslint-disable react/jsx-no-bind */
return (
<View>
@@ -109,30 +116,16 @@ const PollResults = (props: AbstractProps) => {
renderItem = { answer => renderRow(answer.item) } />
<View style = { pollsStyles.bottomLinks as ViewStyle }>
<Button
- id = {
- showDetails
- ? t('polls.results.hideDetailedResults')
- : t('polls.results.showDetailedResults')
- }
- labelKey = {
- showDetails
- ? 'polls.results.hideDetailedResults'
- : 'polls.results.showDetailedResults'
- }
+ accessibilityLabel = { detailsLabelKey }
+ id = { t(detailsLabelKey) }
+ labelKey = { detailsLabelKey }
labelStyle = { pollsStyles.toggleText }
onClick = { toggleIsDetailed }
type = { BUTTON_TYPES.TERTIARY } />
<Button
- id = {
- haveVoted
- ? t('polls.results.changeVote')
- : t('polls.results.vote')
- }
- labelKey = {
- haveVoted
- ? 'polls.results.changeVote'
- : 'polls.results.vote'
- }
+ accessibilityLabel = { voteLabelKey }
+ id = { t(voteLabelKey) }
+ labelKey = { voteLabelKey }
labelStyle = { pollsStyles.toggleText }
onClick = { changeVote }
type = { BUTTON_TYPES.TERTIARY } />