From 707a59a4fcd99fca4898ddebcec6c9fbc8d22ccc Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 26 Jun 2025 15:55:15 +0200 Subject: [PATCH] a11y: improve content description of the close formatting button. Change from "Close" to "Cancel and close text formatting" --- .../libraries/textcomposer/TextComposer.kt | 24 ++++++++++--------- .../impl/src/main/res/values/localazy.xml | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/TextComposer.kt b/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/TextComposer.kt index 815000c626..47216d7e88 100644 --- a/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/TextComposer.kt +++ b/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/TextComposer.kt @@ -178,17 +178,19 @@ fun TextComposer( remember(state.richTextEditorState, composerMode, onResetComposerMode, onError) { @Composable { TextInputBox( - modifier = Modifier.clickable( - interactionSource = remember { MutableInteractionSource() }, - indication = null, - ) { - coroutineScope.launch { - state.requestFocus() - view.showKeyboard() + modifier = Modifier + .clickable( + interactionSource = remember { MutableInteractionSource() }, + indication = null, + ) { + coroutineScope.launch { + state.requestFocus() + view.showKeyboard() + } } - }.semantics { - hideFromAccessibility() - }, + .semantics { + hideFromAccessibility() + }, composerMode = composerMode, onResetComposerMode = onResetComposerMode, isTextEmpty = state.richTextEditorState.messageHtml.isEmpty(), @@ -317,7 +319,7 @@ fun TextComposer( IconColorButton( onClick = onDismissTextFormatting, imageVector = CompoundIcons.Close(), - contentDescription = stringResource(CommonStrings.action_close), + contentDescription = stringResource(R.string.rich_text_editor_close_formatting_options), ) }, textFormatting = textFormattingOptions, diff --git a/libraries/textcomposer/impl/src/main/res/values/localazy.xml b/libraries/textcomposer/impl/src/main/res/values/localazy.xml index 2be7a12577..89331da7ed 100644 --- a/libraries/textcomposer/impl/src/main/res/values/localazy.xml +++ b/libraries/textcomposer/impl/src/main/res/values/localazy.xml @@ -2,7 +2,7 @@ "Add attachment" "Toggle bullet list" - "Close formatting options" + "Cancel and close text formatting" "Toggle code block" "Add a caption" "Encrypted message…"