Skip to content

Textarea is slow when pasting things from the clipboard #831

@cruizba

Description

@cruizba

Describe the bug
Copy and paste things in textarea breaks somehow the fast user experience while using it in a CLI tool.
When you paste a large text into a textarea, all characters are written one by one.
Also, I've noticed that, the larger the text is and the more number of lines it has, user input slows down incrementally.

Setup
Please complete the following information along with version numbers, if applicable.

  • OS: Ubuntu
  • Shell: zsh
  • Terminal Emulator: Terminator

To Reproduce
Steps to reproduce the behavior:

  1. Execute the text area tutorial, change the CharLimit of the TextArea to a high value (so large texts can be pasted) and paste a large file. I am actually pasting a PEM file (a certificate) which has 28 lines and 65 characters per line.
  2. See how the text is being copied character by character, and it slowed down the more characters are currently in the textarea

Source Code
https://github.com/charmbracelet/bubbletea/tree/master/examples/textarea

Expected behavior
It should be fast on pasting things to not break the user experience.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions