☝️ I did a little testing on this earlier, and it turns out my initial query was extremely naive.. I began to notice significant lag with each keystroke at around 150 KB of text in a BasicTextField 😄
would love to hear if anyone has written a custom TextField implementation that handles large amounts of text, or has any advice 🙏
s
spierce7
07/05/2022, 4:40 AM
The demo has a text / code editor. I’d look there first. I assume a code editor would be able to handle large amounts of text.
j
james
07/05/2022, 4:52 AM
the demo is where I found the comment
// TextField isn't efficient for big text files, we use it for simplicity
this was in the Notepad demo, however the code editor is different altogether.. it is read-only, so it uses
Text
to display lines from an immutable string
s
spierce7
07/05/2022, 6:38 AM
I’d take this to the #compose channel. You’ll probably get more traction.
👍🏻 1
k
Kirill Grouchnikov
07/05/2022, 4:36 PM
If you're planning on using it for any sort of "real" editing, it would really need its own component that can do proper text windowing without loading the whole thing into memory.