Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

Editor.Focus() working first time only

$
0
0

Basic project, with this for the main page:

public class App
{
    public static Page GetMainPage()
    {
        var stackLayout = new StackLayout { Padding = new Thickness(50)};
        var editor = new Editor { HeightRequest = 150, WidthRequest = 150, BackgroundColor = Color.Gray};                        
        var button = new Button { Text = "editor.Focus()"};
        button.Clicked += (sender, args) => editor.Focus();
        stackLayout.Children.Add(editor);
        stackLayout.Children.Add(button);
        return new ContentPage { Content = stackLayout };        
    }
}

The editor.Focus() call works fine the first time, the keyboard pops out and the cursor is blinking on the editor. Anyway, after the editor is dismissed, the next click on the button does not produce the same behaviour as before. What am I missing?


Viewing all articles
Browse latest Browse all 91519

Trending Articles