ch4rl3x/HtmlText

onClick/clickable functionality breaks when using HtmlText

DFreds opened this issue · 3 comments

If a parent composable is listening for clicks, the HtmlText stops the clicks from occurring. Here is an example:

    Column {
        Card(
            modifier = Modifier.clickable {
                println("Clicked the html card!") // never triggers
            }
        ) {
            HtmlText(text = "Some <b>bolded and cool</b> text that should click")
        }

        Button(
            onClick = {
                println("Clicked the html button!") // never triggers
            }
        ) {
            HtmlText(text = "Some <b>bolded and cool</b> button")
        }

        Card(
            modifier = Modifier.clickable {
                println("Clicked the non-html card!") // always triggers
            }
        ) {
            Text(text = "Some <b>bolded and cool</b> text that should click")
        }

        Button(
            onClick = {
                println("Clicked the non-html button!") // always triggers
            }
        ) {
            Text(text = "Some <b>bolded and cool</b> button")
        }
    }

What it looks like in preview:
image

Any updates or potential fixes for this?

The problem is that HtmlText itself adds a click listener

Fixed with version 1.3.1