Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ package com.mikepenz.markdown.m2.elements

import androidx.compose.material.Checkbox
import androidx.compose.runtime.Composable
import androidx.compose.ui.semantics.Role.Companion.Checkbox
import androidx.compose.ui.semantics.role
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.stateDescription
import androidx.compose.ui.text.TextStyle
import com.mikepenz.markdown.compose.elements.MarkdownCheckBox
import org.intellij.markdown.ast.ASTNode
Expand All @@ -16,6 +20,13 @@ fun MarkdownCheckBox(
node = node,
style = style,
checkedIndicator = { checked, modifier ->
Checkbox(checked = checked, onCheckedChange = null, modifier = modifier)
Checkbox(
checked = checked,
onCheckedChange = null,
modifier = modifier.semantics {
role = Checkbox
stateDescription = if (checked) "Checked" else "Unchecked"
},
)
},
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ package com.mikepenz.markdown.m3.elements

import androidx.compose.material3.Checkbox
import androidx.compose.runtime.Composable
import androidx.compose.ui.semantics.Role.Companion.Checkbox
import androidx.compose.ui.semantics.role
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.stateDescription
import androidx.compose.ui.text.TextStyle
import com.mikepenz.markdown.compose.elements.MarkdownCheckBox
import org.intellij.markdown.ast.ASTNode
Expand All @@ -16,6 +20,13 @@ fun MarkdownCheckBox(
node = node,
style = style,
checkedIndicator = { checked, modifier ->
Checkbox(checked = checked, onCheckedChange = null, modifier = modifier)
Checkbox(
checked = checked,
onCheckedChange = null,
modifier = modifier.semantics {
role = Checkbox
stateDescription = if (checked) "Checked" else "Unchecked"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where do you want strings to be maintained in the project?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we can depend on the string from the material component, or mimic that one, as I would hope that they handle it properly already

Copy link
Contributor Author

@johnjohndoe johnjohndoe Sep 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I agree. Ultimately it would be patched there to not depend on the handler being set.

},
)
},
)
Loading