Open EndasUP1 opened 2 years ago
@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!
@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/
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!
In default discord you can just Shift + Enter to go into new line, but here can't. Any other way to do it?