Improve chat column behavior for newline in empty text box

Summary: Ref T7538. I got this half correct but not fully correct: when you press enter in an empty text box, do nothing (instead of: sending an empty message, or writing a literal newline).

Test Plan: Hit enter in empty chat column box.

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T7538

Differential Revision: https://secure.phabricator.com/D12089
This commit is contained in:
epriestley
2015-03-16 06:44:07 -07:00
parent cc7a9660b6
commit cf54194ef5
2 changed files with 16 additions and 12 deletions

View File

@@ -296,6 +296,10 @@ JX.behavior('durable-column', function(config, statics) {
return;
}
// From here on, interpret this as a "send" action, not a literal
// newline.
e.kill();
var textarea = _getColumnTextareaNode();
if (!textarea.value.length) {
// If there's no text, don't try to submit the form.