Another similar issue to the above: While I can hi...
# compose-web
s
Another similar issue to the above: While I can highlight text and copy it with ctrl+c, I cannot paste it with ctrl+v, nor use any mouse right click options in text fields.
Tried to implement it manually, but then Skiko's ClipboardManager.setText() method always returns null for some reason...
k
Actually I gone through threads here and found in js copying is async so its isn't impl yet and we can't use .getText() . For setting text you can make expect actual one.
Copy code
internal expect fun writeToClipboard(text: String)
Copy code
internal actual fun writeToClipboard(text: String) {
    window.navigator.clipboard.writeText(text).then {
        showAlert("Copied to clipboard")
    }
}
BUT CTRL A C V AND RIGHT CLICK DOESNT WORK AT ALL
s
This is actually very helpful, thank you. I guess I'll implement the ctrl C/V/X/A manually. I'll share when I'm done.
k
Please share it when done
v
Hello! Could you try to make a small reproducer and, if this behaviour reproduces in it, submit the bug in compose-multiplatform issues?
c
Is this still an issue? Is there not a recommended way to deal with Clipboard in Compose JS/Canvas?
s
@Kapil Yadav I only just managed to make an implementation with the few basic functions working: cut, copy, paste, highlight-all. EDIT: See the link below for the code sample.
@Vladimir Mazunin Seems like there is an issue for it open already. https://github.com/JetBrains/compose-multiplatform/issues/2721
👍 1
I guess I'll provide my workaround there.
k
That's awesome 👍🏼, can you share with me please
@Serge you have any idea about cursor color in web compose ? even I set it with cursorColor its still not visible
s
@Kapil Yadav There is an issue open for it but no updates since May. I will look into it at some point, but not my priority right now.