Skip to content

Commit ba4de50

Browse files
committed
Improve accessibility of ordered and unordered list items.
+ TalkBack will read out e.g. "One, lorem ipsum" instead of "One" for the ordered list item prefix number and then "lorem ipsum" on its own. + Does not apply to list items which prepend a checkbox. Relates #417, #318
1 parent 1c91f54 commit ba4de50

File tree

1 file changed

+2
-0
lines changed
  • multiplatform-markdown-renderer/src/commonMain/kotlin/com/mikepenz/markdown/compose/elements

1 file changed

+2
-0
lines changed

multiplatform-markdown-renderer/src/commonMain/kotlin/com/mikepenz/markdown/compose/elements/MarkdownList.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
88
import androidx.compose.foundation.layout.padding
99
import androidx.compose.runtime.Composable
1010
import androidx.compose.ui.Modifier
11+
import androidx.compose.ui.semantics.semantics
1112
import androidx.compose.ui.text.TextStyle
1213
import com.mikepenz.markdown.compose.LocalBulletListHandler
1314
import com.mikepenz.markdown.compose.LocalMarkdownComponents
@@ -112,6 +113,7 @@ private fun MarkdownListItem(
112113

113114
Row(
114115
modifier = Modifier
116+
.semantics(mergeDescendants = true) {}
115117
.fillMaxWidth()
116118
.padding(top = padding.listItemTop, bottom = padding.listItemBottom)
117119
) {

0 commit comments

Comments
 (0)