Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Prevent digest cycle problem on enter/tab #115

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,18 @@
break;
case Key.Tab:
case Key.Enter:
ctrl.select(ctrl.items[ctrl.activeIndex]);
// wrapping the select call in a $timeout will
// ensure that it will run after the current digest cycle is finished
$timeout(function(){
ctrl.select(ctrl.items[ctrl.activeIndex]);
});
break;
case Key.Escape:
ctrl.close();
// wrapping the select call in a $timeout will
// ensure that it will run after the current digest cycle is finished
$timeout(function(){
ctrl.close();
});
break;
default:
processed = false;
Expand Down