You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I already bent my head around this problem but found no satisfying solution.
I would like my users to be able to submit an input element by hitting enter. But I also want them to be able to create new lines in textareas. Seems that this is not possbile at the same time.
Yes, it is possible to create a new line in a textarea by hitting shift + enter. But this is not a known feature amongst the average internet users. Plus it's impossbile on a touch device.
Can I set preventSubmitOnEnter just for textareas?
The text was updated successfully, but these errors were encountered:
Here is my solution, in case anyone is interested. I updated conversational-form.js.
line 4527, from:
// prevent textarea line breaksif(event.keyCode==cf.Dictionary.keyCodes["enter"]&&!event.shiftKey){event.preventDefault();}
to:
// prevent textarea line breaks, but not in textareas with `rows` > 1if(event.keyCode==cf.Dictionary.keyCodes["enter"]&&!(this.inputElement.hasAttribute('rows')&&parseInt(this.inputElement.getAttribute('rows'))>1)){event.preventDefault();}
I already bent my head around this problem but found no satisfying solution.
I would like my users to be able to submit an input element by hitting enter. But I also want them to be able to create new lines in textareas. Seems that this is not possbile at the same time.
Yes, it is possible to create a new line in a textarea by hitting
shift + enter
. But this is not a known feature amongst the average internet users. Plus it's impossbile on a touch device.Can I set
preventSubmitOnEnter
just for textareas?The text was updated successfully, but these errors were encountered: