multiplatform-markdown-renderer
multiplatform-markdown-renderer copied to clipboard
SelectionContainer prevents clicks on links
About this issue
Link is not clickable when SelectionContainer is used. For example:
SelectionContainer {
Markdown(content = "[test](https://exampmle.com)")
}
It is possible to solve that by using onPointerEvent() with PointerEventPass.Initial. Probably checking if click has finished at the same position as started would do the trick. Could you take a look, please?
Details
version: 0.10.0
This appears to be a more general issue as it seems to be also reported here: https://issuetracker.google.com/issues/184950231
And has also been discussed here: https://slack-chats.kotlinlang.org/t/8320645/click-handling-inside-selectioncontainer-is-still-a-big-prob
Unfortunately I do not see a solution or workaround for these at this time
Unfortunately I do not see a solution or workaround for these at this time
If you know how to get a cursor position at the onPointerEvent(), then it is actually possible to make a workaround, i think. Or am i missing something? Haven't researched enough. I just checked that click events are working correctly
I wasn't able to find a solution back when I last researched it, happy to accept a PR if somebody finds a proper solution/workaround for it.
fwiw,
MaterialTheme {
SelectionContainer {
Markdown(
content = (content)
)
}
}
results in clickable links for us, with no special logic required