compose-multiplatform
compose-multiplatform copied to clipboard
SelectionContainer not working in Web K/Wasm
We are evaluating Compose Web K/Wasm for the development of our admin portal webapps. But first I'm evaluating it in non-critical side project.
I noticed there that when using a Text
composable wrapped in a SelectionContainer
that the text is not selectable.
However if I run the same code as a desktop app, it works as expected. See screen recordings below
Affected platforms
- Web (K/Wasm) - Canvas based API
Versions
- Kotlin version*: 1.9.21
- Compose Multiplatform version*: 1.5.11
- compose-plugin: 1.6.0-alpha01
To Reproduce The following compose code reproduces the issue:
SelectionContainer {
Text("A ISO/IEC 20248 DAID is the same as a ISO/IEC 15459 IAC and CIN concatenated as.....")
}
Expected behavior
Text wrapped in a SelectionContainer
should be selectable in compose web (K/Wasm).
Screen recording Compose Web:
https://github.com/JetBrains/compose-multiplatform/assets/1764844/6c301dbc-ab12-418e-b2e0-2cffb3d17a15
Compose Desktop:
https://github.com/JetBrains/compose-multiplatform/assets/1764844/df1433dd-a1e7-4a39-943a-02e489f2f4ef
@eymar it seems that selection container is working since 1.6.0-rc01. However as soon as I cmd+c
for copying I get a crash.
See attached video:
https://github.com/JetBrains/compose-multiplatform/assets/1764844/1152faa9-46a6-4ce4-b1db-8a56f3d1b0b2
I guess this issue is fixed then, even though the copy functionality is not working. Should we close this issue then? Is there another issue that represents copy crash problem?
@Phaestion Thanks for more details! TBH we didn't explicitly work on this issue yet. I guess it was "fixed" indirectly by some other change. The new crash is clear. Let's keep the issue open until it's fixed completely.
I reopened it for now. ~~There is a new issue with SelectionContainer: https://github.com/JetBrains/compose-multiplatform/issues/1450 (so perhaps something was unintentionaly changed)~~
Closing it as fixed :) We added the tests
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.