From 5364aef96e1125b5091761257049d72acd98726c Mon Sep 17 00:00:00 2001 From: Voula Dionisiou Date: Tue, 13 Sep 2016 16:09:03 +0300 Subject: [PATCH] ListBox scroll issue. When a listbox contains items that are not of type "ListBoxItem" then scrolling causes item selection. There is an issue that demonstrates that (IssueTests/listbox.fap). The above change fixes the problem but I am not very sure if it is the right way to handle it. --- src/Controls/Internal/ItemContainersManager.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Controls/Internal/ItemContainersManager.ts b/src/Controls/Internal/ItemContainersManager.ts index da92968a..2f4a08c5 100644 --- a/src/Controls/Internal/ItemContainersManager.ts +++ b/src/Controls/Internal/ItemContainersManager.ts @@ -128,7 +128,7 @@ module Fayde.Controls.Internal { if (generator.CurrentItem instanceof UIElement) generator.Current = generator.CurrentItem; generator.IsCurrentNew = true; - } else if (cache.length > 0) { + } else if (cache.length > 0 && generator.CurrentItem instanceof UIElement) { generator.Current = cache.pop(); generator.IsCurrentNew = true; } else { @@ -181,4 +181,4 @@ module Fayde.Controls.Internal { CurrentItem: any; CurrentIndex: number; } -} \ No newline at end of file +}