We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

[UWP] Focus problem

Good afternoon,

if i tap/click outside the SfTextInputLayout, the first control takes the focus and this isn't correct i want that the user when taps/clicks outside looses the focus.

My code:

<ContentView.Content>
<ScrollView>
<StackLayout Padding="16">
<sfCards:SfCardView SwipeToDismiss="False" Margin="0,20,0,0" HorizontalOptions="Center" WidthRequest="500">
<StackLayout Padding="16">
<Label x:Name="label_SfCardView_NewDatabase_Title"/>

<sfTextInputLayout:SfTextInputLayout x:Name="sfTextInputLayout_SfCardView_NewDatabase_DatabaseName" ContainerType="Outlined" OutlineCornerRadius="5" ReserveSpaceForAssistiveLabels="True" FocusedColor="#007bff" ErrorColor="#dc3545">
<Entry x:Name="entry_SfCardView_NewDatabase_DatabaseName"/>
</sfTextInputLayout:SfTextInputLayout>

<sfTextInputLayout:SfTextInputLayout x:Name="sfTextInputLayout_SfCardView_NewDatabase_DatabasePath" ContainerType="Outlined" OutlineCornerRadius="5" ReserveSpaceForAssistiveLabels="False" FocusedColor="#007bff" ErrorColor="#dc3545" LeadingViewPosition="Inside" IsVisible="False">
<sfTextInputLayout:SfTextInputLayout.LeadingView>
<ImageButton x:Name="imageButton_SfCardView_NewDatabase_BrowseFolder" HeightRequest="20" Aspect="AspectFit" Source="glyphicons_30_clipboard.png" Clicked="ImageButton_SfCardView_NewDatabase_BrowseFolder_Clicked"/>
</sfTextInputLayout:SfTextInputLayout.LeadingView>

<Entry x:Name="entry_SfCardView_NewDatabase_DatabasePath" IsEnabled="False"/>
</sfTextInputLayout:SfTextInputLayout>

<sfButtons:SfButton x:Name="sfButton_SfCardView_NewDatabase_Confirm" Margin="0,16" CornerRadius="5" HeightRequest="40" BackgroundColor="#007bff" Clicked="SfButton_SfCardView_NewDatabase_Confirm_Clicked" Text="Confirm"/>
</StackLayout>
</sfCards:SfCardView>
</StackLayout>
</ScrollView>
</ContentView.Content>


You can find a video attached.

Thanks in advance

Attachment: 20191106_163407_e39da723.7z

1 Reply

LR Lakshmi Radha Krishnan Syncfusion Team November 7, 2019 02:07 PM UTC

 

Hi Marco,

 

Greetings from Syncfusion.

 

By default, the focus is always set to the first element in UWP platform. You can observe the same behaviour with Entry instead of the SfTextInputLayout.

 

Please refer the reference link to avoid this issue - https://stackoverflow.com/questions/42231163/is-it-possible-to-stop-the-first-entry-getting-focus-in-a-scrollview-in-xamarin/42245601

 

Please check this and let us know if you need further clarification on this.

 

Regards,

Lakshmi R.


Loader.
Live Chat Icon For mobile
Up arrow icon