Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

Commit

Permalink
Improved autocomplete closing after pressing enter (win)
Browse files Browse the repository at this point in the history
  • Loading branch information
IndrekV committed Jun 6, 2018
1 parent a3a5dce commit 45b29e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ private void selectIndex(int index)

public void SelectNext()
{
if (this.visibleItems.Count == 0)
if (this.visibleItems == null || this.visibleItems.Count == 0)
return;

var i = this.selectedIndex + 1;
Expand All @@ -341,7 +341,7 @@ public void SelectNext()

public void SelectPrevious()
{
if (this.visibleItems.Count == 0)
if (this.visibleItems == null || this.visibleItems.Count == 0)
return;

var i = this.selectedIndex - 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,11 @@ private void textboxOnPreviewKeyDown(object sender, KeyEventArgs e)
if (this.IsOpen)
{
if (this.confirmCompletion())
{
e.Handled = true;
}

this.close();
}
return;
}
Expand Down

0 comments on commit 45b29e1

Please sign in to comment.