• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

HTML5 Canvas - Copy text to clipboard / Make text input component multi-line

Contributor ,
Oct 17, 2017 Oct 17, 2017

Copy link to clipboard

Copied

My code generates a multi-line string that I would like to copy to the clipboard so it can be pasted outside of my web app, but I don't know how.

Alternatively I could use a text input component and have the code paste it there, but when I copy the text from the text input, it's no longer multi-line. Normally I would have used a dynamic text field with selectable text, but that's not supported in HTML5 Canvas, same goes for just a standard text input field.

I log the string to the console and it shows up on multiple lines in the console, so it's formatted correctly.

Views

737

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation