question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Chat UI - textarea instead of input / disable send on enter

See original GitHub issue

Issue 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:open
  • Created 4 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
KyleCsercommented, Jan 27, 2020

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.

0reactions
sanketdiwalecommented, Jul 14, 2022

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)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found