facultyai / dash-bootstrap-components

Bootstrap components for Plotly Dash
https://dash-bootstrap-components.opensource.faculty.ai/
Apache License 2.0
1.12k stars 220 forks source link

Add submit_on_enter prop to Textarea #1036

Closed tcbegley closed 6 months ago

tcbegley commented 6 months ago

The Textarea component currently increments n_submit when the enter key is pressed, and the user must press shift + enter in order to create a newline.

This isn't the default behaviour of a <textarea> component. However, since it seems to be common desired behaviour in a chat style application, we shouldn't change the default behaviour.

Instead this PR adds a new prop submit_on_enter, which when set to False, creates a new line in the Textarea and does not increment n_submit.

See #1035