Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onClick/clickable functionality breaks when using HtmlText #6

Closed
DFreds opened this issue Aug 26, 2022 · 3 comments
Closed

onClick/clickable functionality breaks when using HtmlText #6

DFreds opened this issue Aug 26, 2022 · 3 comments

Comments

@DFreds
Copy link

DFreds commented Aug 26, 2022

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

@DFreds
Copy link
Author

DFreds commented Sep 19, 2022

Any updates or potential fixes for this?

@ch4rl3x
Copy link
Owner

ch4rl3x commented Sep 19, 2022

The problem is that HtmlText itself adds a click listener

@ch4rl3x
Copy link
Owner

ch4rl3x commented Sep 19, 2022

Fixed with version 1.3.1

@ch4rl3x ch4rl3x closed this as completed Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants