BotClient icon indicating copy to clipboard operation
BotClient copied to clipboard

feature: send multiline messages

Open EndasUP1 opened this issue 2 years ago • 3 comments

In default discord you can just Shift + Enter to go into new line, but here can't. Any other way to do it?

EndasUP1 avatar May 31 '22 19:05 EndasUP1

@Endass That's because the botclient uses an <input> tag whereas discord originally uses a content-editable div for input. You can't shift+enter in inputs, but making a proper working content-editable is a real pain.

Any other way to do it?

Sadly, there isn't any yet. I intend to replace the input tag with a content-editable div in future. It's even in our to-do!

DarkGuy10 avatar May 31 '22 19:05 DarkGuy10

@Endass That's because the botclient uses an <input> tag whereas discord originally uses a content-editable div for input. You can't shift+enter in inputs, but making a proper working content-editable is a real pain.

Any other way to do it?

Sadly, there isn't any yet. I intend to replace the input tag with a content-editable div in future. It's even in our to-do!

This might be useful https://www.reddit.com/r/reactjs/comments/q3qcc9/anyone_ever_tried_creating_a_text_input_similar/

lazuee avatar Jun 02 '22 13:06 lazuee

This might be useful https://www.reddit.com/r/reactjs/comments/q3qcc9/anyone_ever_tried_creating_a_text_input_similar/

That's oddly specific. Anyways, as you can read in the comments, managing content-editable divs in react is painful, especially with the cursor jumping back to the beginning after each render. There are Slate.js and other libs for this sole purpose, but thanks for the lead!

DarkGuy10 avatar Jun 02 '22 13:06 DarkGuy10