I encountered this issue in compose desktop. I added SelectionContainer to each item in LazyColumn. And after scroll up and down, the error occurred:
Copy code
java.lang.IllegalArgumentException: Another selectable with the id: androidx.compose.foundation.text.selection.MultiWidgetSelectionDelegate@4c3d1aa6.selectableId has already subscribed.
at androidx.compose.foundation.text.selection.SelectionRegistrarImpl.subscribe(SelectionRegistrarImpl.kt:105)
...
anyone know about this issue?🥲
e
Eugen Martynov
06/28/2023, 9:27 AM
Do you provide a key to the item in the lazy column?
j
Jerry Yion
06/28/2023, 9:28 AM
nope, I didn’t pass a key
e
Eugen Martynov
06/28/2023, 9:30 AM
I’m not sure about internals of the compose - what does it uses for the default implementation for the key functionality. Might be the item itself. Could it be that you have double items in the list?
Eugen Martynov
06/28/2023, 9:31 AM
And looks like it is the issue with section item
Eugen Martynov
06/28/2023, 9:32 AM
BTW, what is the section container? I never heard about it
j
Jerry Yion
06/28/2023, 9:33 AM
content in the item like text can be selected and copy if you wrap SelectionContainer to your item