Xamarin Forms, keyboard closing on Entry after every key stroke










0















In some Entry fields the keyboard is closing on every key stroke. This problem was introduced since Xamarin Forms 3.0. So in 2.5 this problem didn't occur.



This problem only occurs in iOS, not Android (afaik).



You can reproduce it with this test code:



Page.xaml:



<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:TestEntryKeyboard" x:Class="TestEntryKeyboard.MainPage">
<StackLayout x:Name="stackTest">
</StackLayout>
</ContentPage>


Page.xaml.cs:



public partial class MainPage : ContentPage

public MainPage()

InitializeComponent();

var table = new TableView()

HorizontalOptions = LayoutOptions.FillAndExpand,
VerticalOptions = LayoutOptions.FillAndExpand,
Intent = TableIntent.Form,
HasUnevenRows = true,
Root = new TableRoot()
;

stackTest.Children.Clear();
stackTest.Children.Add(table);

TableSection section = new TableSection("");
table.Root.Add(section);

for (int index = 1; index < 20; index++)

var viewCell = new ViewCell();
var stack = new StackLayout();
viewCell.View = stack;

var label = new Label() Text = $"Entry index:" ;
stack.Children.Add(label);

var entry = new Entry() ;
stack.Children.Add(entry);

section.Add(viewCell);






On an iPhone SE screen size, the problem occurs in entry field number 10 and 11, at least in my test scenario. If you use an other iPhone with a larger screen size, like XR, the problem occurs in other Entry fields, like for example 15 and 16.



So if you test this, be sure to test in multiple Entry controls, because many will work and only a couple of them not.



My guess is that it has something to do with cell reusing.



NB: The test code I published here is all I use. So I don't use event handlers.










share|improve this question
























  • Did you do something other in the view .Such as add touchevent on the view.I use your code and it works fine.

    – Lucas Zhang - MSFT
    Nov 15 '18 at 6:24











  • @LucasZhang-MSFT Which version of XF do you use. Please know that the problem only occurs from XF 3.0, in iOS and only on some entry fields, depending on the screen size. So for example: field 1 to 9 may work ok, but other fields might not. Also the test code I published here is all I use; no event handlers.

    – John_
    Nov 15 '18 at 8:23











  • I test all entry .I used the xamarin.forms 3.x

    – Lucas Zhang - MSFT
    Nov 15 '18 at 8:28











  • @LucasZhang-MSFT Which iOS version did you use? Device or emulator? Which iPhone?

    – John_
    Nov 15 '18 at 8:48











  • I use iphone se 11.1 and 12.1;iPhone X 12.0

    – Lucas Zhang - MSFT
    Nov 15 '18 at 8:54















0















In some Entry fields the keyboard is closing on every key stroke. This problem was introduced since Xamarin Forms 3.0. So in 2.5 this problem didn't occur.



This problem only occurs in iOS, not Android (afaik).



You can reproduce it with this test code:



Page.xaml:



<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:TestEntryKeyboard" x:Class="TestEntryKeyboard.MainPage">
<StackLayout x:Name="stackTest">
</StackLayout>
</ContentPage>


Page.xaml.cs:



public partial class MainPage : ContentPage

public MainPage()

InitializeComponent();

var table = new TableView()

HorizontalOptions = LayoutOptions.FillAndExpand,
VerticalOptions = LayoutOptions.FillAndExpand,
Intent = TableIntent.Form,
HasUnevenRows = true,
Root = new TableRoot()
;

stackTest.Children.Clear();
stackTest.Children.Add(table);

TableSection section = new TableSection("");
table.Root.Add(section);

for (int index = 1; index < 20; index++)

var viewCell = new ViewCell();
var stack = new StackLayout();
viewCell.View = stack;

var label = new Label() Text = $"Entry index:" ;
stack.Children.Add(label);

var entry = new Entry() ;
stack.Children.Add(entry);

section.Add(viewCell);






On an iPhone SE screen size, the problem occurs in entry field number 10 and 11, at least in my test scenario. If you use an other iPhone with a larger screen size, like XR, the problem occurs in other Entry fields, like for example 15 and 16.



So if you test this, be sure to test in multiple Entry controls, because many will work and only a couple of them not.



My guess is that it has something to do with cell reusing.



NB: The test code I published here is all I use. So I don't use event handlers.










share|improve this question
























  • Did you do something other in the view .Such as add touchevent on the view.I use your code and it works fine.

    – Lucas Zhang - MSFT
    Nov 15 '18 at 6:24











  • @LucasZhang-MSFT Which version of XF do you use. Please know that the problem only occurs from XF 3.0, in iOS and only on some entry fields, depending on the screen size. So for example: field 1 to 9 may work ok, but other fields might not. Also the test code I published here is all I use; no event handlers.

    – John_
    Nov 15 '18 at 8:23











  • I test all entry .I used the xamarin.forms 3.x

    – Lucas Zhang - MSFT
    Nov 15 '18 at 8:28











  • @LucasZhang-MSFT Which iOS version did you use? Device or emulator? Which iPhone?

    – John_
    Nov 15 '18 at 8:48











  • I use iphone se 11.1 and 12.1;iPhone X 12.0

    – Lucas Zhang - MSFT
    Nov 15 '18 at 8:54













0












0








0








In some Entry fields the keyboard is closing on every key stroke. This problem was introduced since Xamarin Forms 3.0. So in 2.5 this problem didn't occur.



This problem only occurs in iOS, not Android (afaik).



You can reproduce it with this test code:



Page.xaml:



<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:TestEntryKeyboard" x:Class="TestEntryKeyboard.MainPage">
<StackLayout x:Name="stackTest">
</StackLayout>
</ContentPage>


Page.xaml.cs:



public partial class MainPage : ContentPage

public MainPage()

InitializeComponent();

var table = new TableView()

HorizontalOptions = LayoutOptions.FillAndExpand,
VerticalOptions = LayoutOptions.FillAndExpand,
Intent = TableIntent.Form,
HasUnevenRows = true,
Root = new TableRoot()
;

stackTest.Children.Clear();
stackTest.Children.Add(table);

TableSection section = new TableSection("");
table.Root.Add(section);

for (int index = 1; index < 20; index++)

var viewCell = new ViewCell();
var stack = new StackLayout();
viewCell.View = stack;

var label = new Label() Text = $"Entry index:" ;
stack.Children.Add(label);

var entry = new Entry() ;
stack.Children.Add(entry);

section.Add(viewCell);






On an iPhone SE screen size, the problem occurs in entry field number 10 and 11, at least in my test scenario. If you use an other iPhone with a larger screen size, like XR, the problem occurs in other Entry fields, like for example 15 and 16.



So if you test this, be sure to test in multiple Entry controls, because many will work and only a couple of them not.



My guess is that it has something to do with cell reusing.



NB: The test code I published here is all I use. So I don't use event handlers.










share|improve this question
















In some Entry fields the keyboard is closing on every key stroke. This problem was introduced since Xamarin Forms 3.0. So in 2.5 this problem didn't occur.



This problem only occurs in iOS, not Android (afaik).



You can reproduce it with this test code:



Page.xaml:



<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:TestEntryKeyboard" x:Class="TestEntryKeyboard.MainPage">
<StackLayout x:Name="stackTest">
</StackLayout>
</ContentPage>


Page.xaml.cs:



public partial class MainPage : ContentPage

public MainPage()

InitializeComponent();

var table = new TableView()

HorizontalOptions = LayoutOptions.FillAndExpand,
VerticalOptions = LayoutOptions.FillAndExpand,
Intent = TableIntent.Form,
HasUnevenRows = true,
Root = new TableRoot()
;

stackTest.Children.Clear();
stackTest.Children.Add(table);

TableSection section = new TableSection("");
table.Root.Add(section);

for (int index = 1; index < 20; index++)

var viewCell = new ViewCell();
var stack = new StackLayout();
viewCell.View = stack;

var label = new Label() Text = $"Entry index:" ;
stack.Children.Add(label);

var entry = new Entry() ;
stack.Children.Add(entry);

section.Add(viewCell);






On an iPhone SE screen size, the problem occurs in entry field number 10 and 11, at least in my test scenario. If you use an other iPhone with a larger screen size, like XR, the problem occurs in other Entry fields, like for example 15 and 16.



So if you test this, be sure to test in multiple Entry controls, because many will work and only a couple of them not.



My guess is that it has something to do with cell reusing.



NB: The test code I published here is all I use. So I don't use event handlers.







c# xamarin xamarin.forms






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 15 '18 at 8:26







John_

















asked Nov 14 '18 at 11:00









John_John_

1063




1063












  • Did you do something other in the view .Such as add touchevent on the view.I use your code and it works fine.

    – Lucas Zhang - MSFT
    Nov 15 '18 at 6:24











  • @LucasZhang-MSFT Which version of XF do you use. Please know that the problem only occurs from XF 3.0, in iOS and only on some entry fields, depending on the screen size. So for example: field 1 to 9 may work ok, but other fields might not. Also the test code I published here is all I use; no event handlers.

    – John_
    Nov 15 '18 at 8:23











  • I test all entry .I used the xamarin.forms 3.x

    – Lucas Zhang - MSFT
    Nov 15 '18 at 8:28











  • @LucasZhang-MSFT Which iOS version did you use? Device or emulator? Which iPhone?

    – John_
    Nov 15 '18 at 8:48











  • I use iphone se 11.1 and 12.1;iPhone X 12.0

    – Lucas Zhang - MSFT
    Nov 15 '18 at 8:54

















  • Did you do something other in the view .Such as add touchevent on the view.I use your code and it works fine.

    – Lucas Zhang - MSFT
    Nov 15 '18 at 6:24











  • @LucasZhang-MSFT Which version of XF do you use. Please know that the problem only occurs from XF 3.0, in iOS and only on some entry fields, depending on the screen size. So for example: field 1 to 9 may work ok, but other fields might not. Also the test code I published here is all I use; no event handlers.

    – John_
    Nov 15 '18 at 8:23











  • I test all entry .I used the xamarin.forms 3.x

    – Lucas Zhang - MSFT
    Nov 15 '18 at 8:28











  • @LucasZhang-MSFT Which iOS version did you use? Device or emulator? Which iPhone?

    – John_
    Nov 15 '18 at 8:48











  • I use iphone se 11.1 and 12.1;iPhone X 12.0

    – Lucas Zhang - MSFT
    Nov 15 '18 at 8:54
















Did you do something other in the view .Such as add touchevent on the view.I use your code and it works fine.

– Lucas Zhang - MSFT
Nov 15 '18 at 6:24





Did you do something other in the view .Such as add touchevent on the view.I use your code and it works fine.

– Lucas Zhang - MSFT
Nov 15 '18 at 6:24













@LucasZhang-MSFT Which version of XF do you use. Please know that the problem only occurs from XF 3.0, in iOS and only on some entry fields, depending on the screen size. So for example: field 1 to 9 may work ok, but other fields might not. Also the test code I published here is all I use; no event handlers.

– John_
Nov 15 '18 at 8:23





@LucasZhang-MSFT Which version of XF do you use. Please know that the problem only occurs from XF 3.0, in iOS and only on some entry fields, depending on the screen size. So for example: field 1 to 9 may work ok, but other fields might not. Also the test code I published here is all I use; no event handlers.

– John_
Nov 15 '18 at 8:23













I test all entry .I used the xamarin.forms 3.x

– Lucas Zhang - MSFT
Nov 15 '18 at 8:28





I test all entry .I used the xamarin.forms 3.x

– Lucas Zhang - MSFT
Nov 15 '18 at 8:28













@LucasZhang-MSFT Which iOS version did you use? Device or emulator? Which iPhone?

– John_
Nov 15 '18 at 8:48





@LucasZhang-MSFT Which iOS version did you use? Device or emulator? Which iPhone?

– John_
Nov 15 '18 at 8:48













I use iphone se 11.1 and 12.1;iPhone X 12.0

– Lucas Zhang - MSFT
Nov 15 '18 at 8:54





I use iphone se 11.1 and 12.1;iPhone X 12.0

– Lucas Zhang - MSFT
Nov 15 '18 at 8:54












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53298649%2fxamarin-forms-keyboard-closing-on-entry-after-every-key-stroke%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53298649%2fxamarin-forms-keyboard-closing-on-entry-after-every-key-stroke%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Top Tejano songwriter Luis Silva dead of heart attack at 64

ReactJS Fetched API data displays live - need Data displayed static

Evgeni Malkin