Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report for Bug 44966 on
Developer Community or GitHub if you have new
information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
# Steps to reproduce
1. Add any Entry or Editor view on a page and focus on it - software keyboard should appear
2. Tap on any other control, e.g. "Send" button - focus get lost, keyboard hides
# Expected behavior
In many cases, we don't need to unfocus just after clicking on another control! For example, in iOS iMessage or Facebook Messenger apps (actually in many more apps) when sending a message by pressing "Send" button the focus is not lost. And you can just type another message and another one and so on. So buttons clicking are handled without getting focus, it's just different concepts! It's unclear why in the first place does button may need to get focus in a mobile app? It's impossible now to lock focus for input fields in Xamarin.Forms app, it's internally hard-coded behavior.
# Actual behavior
Focus for any input field is always lost on any other active view tap. For example, on pressing "Send" button focus is lost and keyboard hides, and we need to tap input field again to send another message.
I suggest adding `IsFocusable` property to the `View` class and if it's set to `false`, then that instance won't capture focus. It's simple non-breaking change that will increase flexibility and solve the problem.
# Related links
What happens if you set IsEnabled to false on other controls? Does the keyboard still hide?
Also, in iMessage window, I believe the textbox and the send button are PART of the keyboard. I recently worked on https://github.com/xamarin/Xamarin.Forms/pull/407 though it doesn't have an option to add an Entry. You could use system buttons whose actions DO NOT call unfocus.
> What happens if you set IsEnabled to false on other controls? Does the keyboard still hide?
Not tested yet and probably for some cases it can be a workaround. But I might want to have many interactive elements which don't catch focus. Like I may want to enable copy & paste actions for messages on long tap. And the keyboard doesn't need to be hidden on this action.
On iOS, only another input may intercept focus automatically but not button or other interactive control.
We just need more native UX / UI and this is one of the patterns which breaks it.
> Also, in iMessage window, I believe the textbox and the send button are PART of the keyboard.
Not sure if it possible at all. In every tutorial about such construction, I saw that animation is required to move controls up and down on keyboard events.
It's possible to add buttons, but I never saw that it's possible to add an input field.
Ah. Now that I looked at iOS 10 again, it's more evident that the controls are not part of the keyboard. I agree that this kind of functionality should be added. It'd be very useful.
useful feature. Especially when supplying a custom onscreen keyboard
Also working on a chat app here, this would GREATLY improve QOL.
Tis would also increase the consistency between native platforms. After some testing it occurs that for IOS not all elements tapped 'steal' the focus (ex List item tabbed do not grab focus) while on Android more elements take always the focus )list items tapped grab the focus). Having a clear property that controls which elements should grab focus would bring clarity to how focus is handed and give back control to the developer across platforms.
Being able to control the focus grabbing capabilities per elements should be very helpful in creating more platform consistent, robust and improved UI experiences.
I support the fix and would urge to have the importance increased to High instead.
Solutions around this problem for now forces people to be very creative with dirty hacks which will surely not be future proof.
Priotisation of this issue is advised and would be very welcomed.