Chat UI - textarea instead of input / disable send on enter
See original GitHub issueIssue type
I’m submitting a … (check one with “x”)
- bug report
- feature request
Issue description
Current behavior:
- Text input will not allow line breaks
- Enter button sends message
Expected behavior:
- Input will be a textarea element
- Enter button will insert a line break
Steps to reproduce: Include any basic ChatUI element
Other information:
npm, node, OS, Browser
Angular, Nebular
Angular CLI: 8.3.20
Nebular: 4.5.0
Issue Analytics
- State:
- Created 4 years ago
- Comments:6
Top Results From Across the Web
How can I disable the ENTER key on my textarea?
I have this form... it doesn't have a submit button because I am using jquery and under this form is a div area...
Read more >Entry - .NET MAUI - Microsoft Learn
The .NET MAUI Entry allows you to enter and edit a single line of text. ... Enable and disable text prediction; Prevent text...
Read more ><input type="text"> - HTML: HyperText Markup Language | MDN
The value attribute is a string that contains the current value of the text entered into the text field. You can retrieve this...
Read more >Bootstrap Input fields - examples & tutorial
Add the disabled boolean attribute on an input to give it a grayed out appearance and remove pointer events. Disabled. Show code.
Read more >ui.textarea, API Reference Webix Docs - Documentation
Where to start ; onDestruct, occurs when component destroyed ; onEnter, fires when the Enter key has been pressed ; onFocus, fires when...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Using a key press combination to send is pretty standard in most web chat forms.
I would take your example a step further and add a parameter to conditionally display an input or textarea. Supporting a custom nb-chat-form would be another great alternative if it’s not already possible.
Another way I have seen this handled in some chatboxes is to use “Shift key + Enter” as a way to allow for new line in the text box, while the normal enter key is used for send. I wonder if it would be easier to just add a case for handling the “Shift+Enter” alongside the normal send behavior and set the default type of input to always be a textarea (instead of having two input field types to choose from)