multiplatform-markdown-renderer icon indicating copy to clipboard operation
multiplatform-markdown-renderer copied to clipboard

SelectionContainer prevents clicks on links

Open Melodeiro opened this issue 1 year ago • 4 comments

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

Melodeiro avatar Dec 15 '23 05:12 Melodeiro

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

mikepenz avatar Jan 12 '24 10:01 mikepenz

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

Melodeiro avatar Jan 12 '24 13:01 Melodeiro

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.

mikepenz avatar Feb 17 '24 11:02 mikepenz

fwiw,

MaterialTheme {
    SelectionContainer {
      Markdown(
        content = (content)
      )
    }
}

results in clickable links for us, with no special logic required

androidacy-user avatar Apr 08 '24 01:04 androidacy-user