diff --git a/core/client/components/gh-navitem-url-input.js b/core/client/components/gh-navitem-url-input.js index 14b5d3aaf1..5f6ca2c392 100644 --- a/core/client/components/gh-navitem-url-input.js +++ b/core/client/components/gh-navitem-url-input.js @@ -58,8 +58,23 @@ var NavItemUrlInputComponent = Ember.TextField.extend({ } }, + keyPress: function (event) { + // enter key + if (event.keyCode === 13) { + event.preventDefault(); + this.notifyUrlChanged(); + } + + return true; + }, + focusOut: function () { this.set('hasFocus', false); + + this.notifyUrlChanged(); + }, + + notifyUrlChanged: function () { this.set('value', this.get('value').trim()); var url = this.get('value'),