You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On UWP a view loses its focus if it is removed from its parent view. In TagEntryView.ForceReload() you call in line 214 Children.Clear() which removes all child views from your control, including your Entry control.
To prevent your control from losing focus, you should only remove your tag views, not the entry from the layout. A solution could look like this:`
public void ForceReload()
{
if (TagItems == null)
return;
List<View> list = Children.ToList();
foreach (var view in list)
{
if (view != TagEntry)
{
Children.Remove(view);
}
}
for (int i = 0; i < TagItems.Count; i++)
{
View view = null;
if (TagItemTemplate is DataTemplateSelector templateSelector)
{
var template = templateSelector.SelectTemplate(TagItems[i], null);
view = (View)template.CreateContent();
}
else
{
view = (View)TagItemTemplate.CreateContent();
}
view.BindingContext = TagItems[i];
view.GestureRecognizers.Add(new TapGestureRecognizer()
{
Command = new Command(() => PerformTagTap(view.BindingContext))
});
Children.Insert(Children.Count - 1, view);
}
}
`
Best regards
Andreas | jalada GmbH
The text was updated successfully, but these errors were encountered:
On UWP a view loses its focus if it is removed from its parent view. In TagEntryView.ForceReload() you call in line 214 Children.Clear() which removes all child views from your control, including your Entry control.
To prevent your control from losing focus, you should only remove your tag views, not the entry from the layout. A solution could look like this:`
`
Best regards
Andreas | jalada GmbH
The text was updated successfully, but these errors were encountered: