I've got a lazy column of text lines wrapped with ...
# compose
a
I've got a lazy column of text lines wrapped with a SelectionContainer. It works quite nicely as long as I don't scroll, if I scroll, the selection simply stops working when the first selected item is no longer visible. Sample to reproduce it:
Copy code
SelectionContainer {
        LazyColumn {
            items(100) {
                Text("Line number $it")
            }
        }
    }
The "copy" button also jumps around in the same situation. Seems like a compose bug but not completly sure. A normal column works without any issues (expected since everything is composed unlike the LazyColumn).
c
I can’t tell what I’m supposed to see in the video. What behaviour are you expecting, versus what is actually happening? Personally I would not expect selection to work across multiple items in a LazyColumn when those items go offscreen (since those items get removed from the composition). What is your use case? What are you trying to achieve?
a
the selection simply stops working when the first selected item is no longer visible
Mostly this. I can no longer select items if the first select item is no longer visible. In my case, I'm trying to show the lines of a text document in my compose-desktop app (exactly same issue), so using a column is not an option as the files can be quite large
I'm aware that it may not have solution but if that's the case, a warning or something similar should be displayed, as it's not obvious. Also, not sure how can I achieve that behavior without a lazy column.
c
Interesting. I don’t think Compose is well-suited for documents manipulation (yet). But I’ve read that this is an active area of research for Google so they may be interested in hearing more about your use case. Plenty of Googlers around here
What do users need to select the text for? Copy-paste?
a
Exactly. It's actually a Git client. I've found myself many times in the situation where I wanted to copy a fragment of code and this issue is extremly annoying
c
Try searching for existing feature requests related to documents, and star those issues. And add a comment to explain your use case. I believe this is the best way to get your needs across to the Compose team
a
I've searched quite a bit but I haven't found anything similar, I may have used the wrong search terms tho