View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001918 | NoesisGUI | C# SDK | public | 2021-02-04 16:31 | 2021-02-10 01:23 |
| Reporter | stonstad | Assigned To | jsantos | ||
| Priority | normal | Severity | major | ||
| Status | resolved | Resolution | fixed | ||
| Product Version | 3.0.9 | ||||
| Target Version | 3.0.10 | Fixed in Version | 3.0.10 | ||
| Summary | 0001918: TouchBox Does Not Receive Focus as Expected | ||||
| Description | See screenshot and associated XAML. This behavior happens on Android builds and in the Unity Editor when Emulate Touch is enabled. TextBoxes inconsistently respond to an initial touch, and focus is not set. I have to repeatedly touch the control for it to finally receive focus. The behavior is reproducible in Unity when Emulate Touch is enabled. On touch devices (Android) it happens consistently. | ||||
| Attached Files | SharingControl.cs (5,228 bytes)
using MBI.CustomerSelect.Unity.Domain;
using Noesis;
using System;
using GUI = Noesis.GUI;
using NoesisEventArgs = Noesis.EventArgs;
namespace MBI.CustomerSelect.Unity.UI
{
public partial class SharingControl : UserControl
{
private FrameworkElement _Root;
private TextBox _FromTextBox;
private TextBox _ToTextBox;
private RadioButton _MobileRadioButton;
private RadioButton _EmailRadioButton;
private StackPanel _DetailStackPanel;
private TextBlock _MobileText;
private TextBlock _EmailText;
private TextBox _MobileTextBox;
private TextBox _EmailTextBox;
private Button _OKButton;
private Button _CancelButton;
public Action Closed { get; set; }
public ProjectInvitation Result { get; private set; }
public SharingControl()
{
this.Initialized += OnInitialized;
this.InitializeComponent();
}
private void InitializeComponent()
{
GUI.LoadComponent(this, "Assets/User Interface/Controls/SharingControl.xaml");
_Root = Content as FrameworkElement;
_FromTextBox = _Root.FindName("_FromTextBox") as TextBox;
_ToTextBox = _Root.FindName("_ToTextBox") as TextBox;
_MobileRadioButton = _Root.FindName("_MobileRadioButton") as RadioButton;
_EmailRadioButton = _Root.FindName("_EmailRadioButton") as RadioButton;
_DetailStackPanel = _Root.FindName("_DetailStackPanel") as StackPanel;
_MobileText = _Root.FindName("_MobileText") as TextBlock;
_EmailText = _Root.FindName("_EmailText") as TextBlock;
_MobileTextBox = _Root.FindName("_MobileTextBox") as TextBox;
_EmailTextBox = _Root.FindName("_EmailTextBox") as TextBox;
_OKButton = _Root.FindName("_OKButton") as Button;
_CancelButton = _Root.FindName("_CancelButton") as Button;
}
private void OnInitialized(object sender, NoesisEventArgs args)
{
_MobileRadioButton.Checked += (sender2, e) =>
{
_DetailStackPanel.Visibility = Visibility.Visible;
_MobileText.Visibility = Visibility.Visible;
_EmailText.Visibility = Visibility.Collapsed;
_MobileTextBox.Visibility = Visibility.Visible;
_EmailTextBox.Visibility = Visibility.Collapsed;
Validate();
};
_EmailRadioButton.Checked += (sender2, e) =>
{
_DetailStackPanel.Visibility = Visibility.Visible;
_MobileText.Visibility = Visibility.Collapsed;
_EmailText.Visibility = Visibility.Visible;
_MobileTextBox.Visibility = Visibility.Collapsed;
_EmailTextBox.Visibility = Visibility.Visible;
Validate();
};
_EmailTextBox.TextChanged += (sender2, e) => Validate();
_MobileTextBox.TextChanged += (sender2, e) => Validate();
_FromTextBox.TextChanged += (sender2, e) => Validate();
_ToTextBox.TextChanged += (sender2, e) => Validate();
_OKButton.Click += (sender2, e) =>
{
Result = new ProjectInvitation();
if (_MobileRadioButton.IsChecked.Value)
{
Result.DeliveryType = ContactType.Phone;
Result.RecipientMobilePhone = _MobileTextBox.Text;
}
else
{
Result.DeliveryType = ContactType.Email;
Result.RecipientEmailAddress = _EmailTextBox.Text;
}
Result.SenderFirstName = _FromTextBox.Text;
Result.RecipientFirstName = _ToTextBox.Text;
Hide();
};
_CancelButton.Click += (sender2, e) =>
{
Result = null;
Hide();
};
}
public void Show()
{
MainControl.Instance.ShowPopup(this, true);
}
public void Hide()
{
MainControl.Instance.HidePopup();
Closed?.Invoke();
}
private void Validate()
{
if (_MobileRadioButton.IsChecked.Value)
{
string mobileNumber = _MobileTextBox.Text.Replace("-", string.Empty);
_OKButton.IsEnabled =
mobileNumber.Length == 10 &&
_FromTextBox.Text.Length > 0 &&
_ToTextBox.Text.Length > 0;
}
else if (_EmailRadioButton.IsChecked.Value)
{
string emailText = _EmailTextBox.Text.Replace("-", string.Empty);
_OKButton.IsEnabled =
emailText.Length > 3 &&
emailText.Contains("@") &&
_FromTextBox.Text.Length > 0 &&
_ToTextBox.Text.Length > 0;
}
}
}
} SharingControl.xaml (3,231 bytes)
<UserControl
x:Class="MBI.CustomerSelect.Unity.UI.SharingControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
x:Name="_SliderControl">
<Grid Margin="10" VerticalAlignment="Top" MinWidth="225">
<Grid.LayoutTransform>
<ScaleTransform ScaleX="1.4" ScaleY="1.4"/>
</Grid.LayoutTransform>
<Grid Background="{StaticResource BackgroundColor}">
<Grid.Effect>
<DropShadowEffect BlurRadius="25" Direction="270" ShadowDepth="6" Opacity="0.6" Color="Black"/>
</Grid.Effect>
</Grid>
<StackPanel Orientation="Vertical">
<Border Background="{DynamicResource Brush.Item.SelectedOver}">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="3">
<TextBlock FontFamily="{StaticResource FontAwesome}" FontSize="15" FontWeight="Light" Foreground="#FFFFFFFF" Margin="-25, 0, 0, 0" VerticalAlignment="Center" Text=""/>
<TextBlock FontSize="16" Margin="4" Foreground="#FFFFFFFF" Text="SHARE"/>
</StackPanel>
</Border>
<StackPanel Orientation="Vertical" Margin="20, 15, 20, 20">
<TextBlock>SHARE PROJECT</TextBlock>
<RadioButton x:Name="_MobileRadioButton" Margin="0, 10, 0, 5" IsChecked="true">
<TextBlock>
<Run>Text Message</Run>
<!--<Run>(includes link to Apple Store and Google Play)</Run>-->
</TextBlock>
</RadioButton>
<RadioButton x:Name="_EmailRadioButton" Margin="0, 0, 0, 0">
<TextBlock>
<Run>Email</Run>
<!--<Run>(includes link to to website)</Run>-->
</TextBlock>
</RadioButton>
<StackPanel x:Name="_DetailStackPanel" Orientation="Vertical" Margin="0, 20, 0, 0">
<TextBlock x:Name="_MobileText">Recipient Mobile Number</TextBlock>
<TextBox x:Name="_MobileTextBox"/>
<TextBlock x:Name="_EmailText" Visibility="Collapsed">Recipient Email Address</TextBlock>
<TextBox x:Name="_EmailTextBox" Visibility="Collapsed"/>
<TextBlock Margin="0, 5, 0, 0">To</TextBlock>
<TextBox x:Name="_ToTextBox"/>
<TextBlock Margin="0, 5, 0, 0">From</TextBlock>
<TextBox x:Name="_FromTextBox" Text="Builder"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="20" HorizontalAlignment="Center">
<Button x:Name="_OKButton" IsEnabled="false" Margin="0, 0, 5, 0" MinWidth="60" Content="OK"/>
<Button x:Name="_CancelButton" Margin="0, 0, 0, 0" MinWidth="60" Content="Cancel"/>
</StackPanel>
</StackPanel>
</Grid>
</UserControl> | ||||
| Platform | Any | ||||
|
I have to spam touches on a TextBox control to get it to focus. |
|
|
I think this is the consequence of this issue: 0001887 Does it happen when you touch on a TextBox and then try to touch another control? |
|
|
If you touch on an empty space and then on the TextBox, does it get the focus on first touch? |
|
|
Sergio, you are correct. If I touch something that is not a user control I can then focus a textbox. |
|
|
This issue affects a fielded/production application. Are there any work-arounds or an interim patch DLL available? Thanks, |
|
|
We are working on this, plan is having a release in 24h. If not possible I will try to give you a patch. |
|
|
Understood and thank you! |
|
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2021-02-04 16:31 | stonstad | New Issue | |
| 2021-02-04 16:31 | stonstad | File Added: CustomerSelect1.PNG | |
| 2021-02-04 16:31 | stonstad | File Added: SharingControl.cs | |
| 2021-02-04 16:31 | stonstad | File Added: SharingControl.xaml | |
| 2021-02-04 16:32 | stonstad | Note Added: 0007019 | |
| 2021-02-04 19:16 | sfernandez | Assigned To | => jsantos |
| 2021-02-04 19:16 | sfernandez | Status | new => assigned |
| 2021-02-04 19:16 | sfernandez | Product Version | 3.0 => 3.0.9 |
| 2021-02-04 19:16 | sfernandez | Target Version | => 3.0.10 |
| 2021-02-04 19:16 | sfernandez | Description Updated | |
| 2021-02-04 19:19 | sfernandez | Status | assigned => feedback |
| 2021-02-04 19:19 | sfernandez | Note Added: 0007020 | |
| 2021-02-04 19:19 | sfernandez | Relationship added | related to 0001887 |
| 2021-02-04 19:31 | sfernandez | Note Added: 0007021 | |
| 2021-02-04 23:42 | stonstad | Note Added: 0007022 | |
| 2021-02-04 23:42 | stonstad | Status | feedback => assigned |
| 2021-02-09 15:02 | stonstad | Note Added: 0007026 | |
| 2021-02-09 15:47 | jsantos | Note Added: 0007027 | |
| 2021-02-09 18:54 | stonstad | Note Added: 0007028 | |
| 2021-02-10 01:23 | jsantos | Status | assigned => resolved |
| 2021-02-10 01:23 | jsantos | Resolution | open => fixed |
| 2021-02-10 01:23 | jsantos | Fixed in Version | => 3.0.10 |