summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--web-ui/app/js/mail_view/ui/recipients/recipients_input.js1
-rw-r--r--web-ui/test/spec/mail_view/ui/recipients/recipients_input.spec.js16
2 files changed, 15 insertions, 2 deletions
diff --git a/web-ui/app/js/mail_view/ui/recipients/recipients_input.js b/web-ui/app/js/mail_view/ui/recipients/recipients_input.js
index e9211d85..b65e6080 100644
--- a/web-ui/app/js/mail_view/ui/recipients/recipients_input.js
+++ b/web-ui/app/js/mail_view/ui/recipients/recipients_input.js
@@ -34,7 +34,6 @@ define([
9: 'tab',
186: 'semicolon',
188: 'comma',
- 32: 'space',
13: 'enter',
27: 'esc'
},
diff --git a/web-ui/test/spec/mail_view/ui/recipients/recipients_input.spec.js b/web-ui/test/spec/mail_view/ui/recipients/recipients_input.spec.js
index 6b486fa9..51001e5e 100644
--- a/web-ui/test/spec/mail_view/ui/recipients/recipients_input.spec.js
+++ b/web-ui/test/spec/mail_view/ui/recipients/recipients_input.spec.js
@@ -10,7 +10,6 @@ describeComponent('mail_view/ui/recipients/recipients_input',function () {
_.each([
[186, 'semicolon'],
[188, 'comma'],
- [32, 'space']
], function (keycode) {
@@ -77,6 +76,21 @@ describeComponent('mail_view/ui/recipients/recipients_input',function () {
expect(addressEnteredEvent).not.toHaveBeenTriggeredOnAndWith(this, { name: 'to', address: ''});
});
});
+
+ describe('when space is pressed', function () {
+ it('address input should not finish', function () {
+ var addressEnteredEvent = spyOnEvent(this.$node, Pixelated.events.ui.recipients.entered);
+
+ var spaceKeyPressEvent = $.Event('keydown', { which: 32});
+ spyOn(spaceKeyPressEvent, 'preventDefault');
+
+ this.$node.val('a@b.c');
+ this.$node.trigger(spaceKeyPressEvent);
+
+ expect(spaceKeyPressEvent.preventDefault).not.toHaveBeenCalled();
+ expect(addressEnteredEvent).not.toHaveBeenTriggeredOnAndWith(this, { name: 'to', address: 'a@b.c' });
+ });
+ });
});
describe('on keyup', function () {