compose-richtext icon indicating copy to clipboard operation
compose-richtext copied to clipboard

Fixes linkClickHandler not working in inner uses of BasicRichText.

Open vitorpamplona opened this issue 1 year ago • 2 comments

linkClickHandler is not passing around when new BasicRichTexts are instantiated.

I am not sure if this is the correct way of solving it, but this applies the same LocalLinkClickHandler to the entire hierarchy of nodes, not just the first level. It seems better than passing it around to new instances of BasicRichTexts.

FYI, in the demo, the click worked but wasn't handled by the custom handler. It was using the default LocalUriHandler.current.

vitorpamplona avatar Apr 08 '24 17:04 vitorpamplona

First of all thanks for finding this out. I believe there is a simpler solution to this problem that doesn't require us exposing a CompositionLocal.

halilozercan avatar Apr 08 '24 19:04 halilozercan

Frankly, I am not sure a custom handler is needed. I have specific needs to intercept it, but maybe the average user is ok on having just the LocalUriHandler.current

vitorpamplona avatar Apr 08 '24 20:04 vitorpamplona