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

Calling Focus() on an Editor or Entry Crash looking for a work around

$
0
0

I'm looking for any ideas for a workaround for this bug.
https://bugzilla.xamarin.com/show_bug.cgi?id=58988

Problem is if I ever call Focus() on an Entry on any page all other pages including the one I was on if I ever return to it no longer allow me to type in them.

I tried switching them to an Editor. Editors end up doing the same thing. Though I noticed this time If I left the page again I would get a null reference exception in main.cs.

This is only affecting iOS that I've tried so far.

What I'm working on is an app that works with Bluetooth scanners. On iOS Bluetooth scanners take over the role of the on screen virtual keyboard, and usually disable the virtual keyboard. Yeah it's a weird quirk of iOS. Anyways since the scanner is acting as the keyboard and is doing all of my input I want to handle that input programatically. I found though when I do something like myEntry.text = ""; The Entry looses focus. So I was calling myEntry.Focus(); to maintain the focus on the control. I didn't want the user to have to keep tapping the Entry for each scan. As long as I stayed on the one page it works great. If I navigate away and come back.... the bug hits and it all stops working. Even tapping the Entry does nothing. It all works fine if I never call Focus(); But then the user has to keep tapping that control for each scan which isn't desirable.

Anyone have any thoughts on how I can maintain focus on the control, or any other ideas for a work around?


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>