Keypad is closing and reopens again when focus changes from entry to another entry field

VickVick Member ✭✭

Hi, In my login form when when i change the focus from username to password field then keypad is closing and reopens again, Which i don't want.It should persist as it is. Here my UI is.

<ContentPage.Content>

        <StackLayout Orientation="Vertical" BackgroundColor="#FFFFFF">
            <StackLayout Orientation="Horizontal" Margin="0,0,0,10" HeightRequest="60"  BackgroundColor="#0B1C2C">
                <Label TextColor="White" Margin="30,10,0,0"  FontSize = "22" Text="abc" />
                <Label TextColor="#F5CC7A" Margin="0,5,0,0" HorizontalOptions="Center" FontSize = "24" Text="abc" />
                <Label TextColor="White" Margin="20,15,40,0"  FontSize = "14" Text="ABC" />
            </StackLayout>

            <StackLayout Orientation="Vertical" Padding="5" BackgroundColor="White">
                <Label TextColor="Gray" Margin="20,100,0,0"  FontSize = "30" Text="Sign in" />
                <Label TextColor="Gray" Margin="20,5,0,0" FontSize = "20" Text="Please enter your details below."/>
                <Frame  HasShadow="False"  Margin="0,5,0,0"  x:Name="MainLayout">
                    <!-- Margin  Left,Top,Right,Bottom-->
                    <StackLayout Orientation="Vertical" Spacing="5" >
                        <Label TextColor="Black"  FontSize = "12" Text=" Username" />
                        <Entry x:Name="UserName" Text="{Binding UserName}" Placeholder="Username"   
                      HeightRequest="40" FontSize = "14"              Keyboard="Email"  
                               TextColor="Black" />
                        <Label TextColor="Black" FontSize = "12" Text=" Password" />
                        <Entry x:Name="Password" Text="{Binding Password}" Placeholder="Password"   FontSize = "14" 
                      HeightRequest="40" IsPassword="True"  TextColor="Black" />
                        <Button x:Name="BtnLogin" Clicked="LoginButton_Click" Text="Login"  Margin="0,0,5,0" WidthRequest="150" HorizontalOptions="Start" TextColor="#FFFFFF" BackgroundColor="#0B1C2C" />

                    </StackLayout>
                </Frame>

            </StackLayout>  
</StackLayout>  

<ContentPage.Content>

Focus is changing in the constructor of my form using:
UserName.Completed += (object sender, EventArgs e) => {Password.Focus();};

Answers

  • shubham1shubham1 Member ✭✭✭

    It will persist but when you will use the same keyboard in both the entry.

  • VickVick Member ✭✭

    @Shubhuuu -No, it is behaviring the same. even i changed the attribute Keyboard="Email" in password Entry.

  • shubham1shubham1 Member ✭✭✭

    Try to do so-
    comment this line-- UserName.Completed += (object sender, EventArgs e) => {Password.Focus();};
    and then run your application.

  • VickVick Member ✭✭

    @Shubhuuu - Thanks for reply,
    I also did this but in this case end user will have to tap on password field for entering the password.
    other thing is this when user enters the username and press done button then keyboard is disappearing in this case also and it appears after tap on password entry.

  • VickVick Member ✭✭

    @Vick said:
    @Shubhuuu - Thanks for reply,
    I also did this but in this case end user will have to tap on password field for entering the password.
    other thing is this when user enters the username and press done button then keyboard is disappearing in this case, also and it appears after tap on password entry.

    Which actually i don't want...

  • shubham1shubham1 Member ✭✭✭

    @Vick said:

    @Vick said:
    @Shubhuuu - Thanks for reply,
    I also did this but in this case end user will have to tap on password field for entering the password.
    other thing is this when user enters the username and press done button then keyboard is disappearing in this case, also and it appears after tap on password entry.

    Which actually i don't want...

    Yep. I understand what you actually want. Somebody do some help here.

  • VickVick Member ✭✭

    @Shubhuuu -Thanks Brother for your attempts.

  • shubham1shubham1 Member ✭✭✭

    @Vick said:
    @Shubhuuu -Thanks Brother for your attempts.

    No problem brother.

Sign In or Register to comment.