jeziellago / compose-markdown

Markdown Text for Android Jetpack Compose đź“‹.
MIT License
594 stars 51 forks source link

Add a way to enable/disable ripple on markdown text composable. #111

Closed robercoding closed 3 months ago

robercoding commented 4 months ago

Currently clicking on the MarkdownText shows up the ripple. I'd like to have the ability to enable it or not.

image

Although the MarkdownText gives the ability to add an action happening on click. The ripple still happens it's null. The AndroidView has a clickable modifier that is enabled by default, and there's no way to disable it. modifier = Modifier.clickable { onClick?.let { it() } }.then(modifier)

If this clickable is the responsible for adding the ripple then I see 3 ways to add the option to enable it or not:

Lib version: 0.5.1

What do you think?

gapon0ff commented 3 months ago

As a temporary option, defining a custom modifier with the same property is suitable for me:

    MarkdownText(
        markdown = "",
        modifier = Modifier
            .clickable(
                enabled = false,
                onClick = {},
            ),
    )