Skip to content
This repository has been archived by the owner on Apr 21, 2022. It is now read-only.

Commit

Permalink
don't catch event when pressing enter if there is nothing to do
Browse files Browse the repository at this point in the history
  • Loading branch information
macherel committed Jan 26, 2016
1 parent 906f411 commit 55735a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dist/smart-area.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ angular.module('smartArea', [])
$scope.keyboardEvents = function(event){
if($scope.dropdown.content.length > 0) {
var code = event.keyCode || event.which;
if (code === 13) { // Enter
if (code === 13 && $scope.dropdown.current !== -1) { // Enter
event.preventDefault();
event.stopPropagation();
// Add the selected word from the Dropdown
Expand Down

0 comments on commit 55735a6

Please sign in to comment.