Items in background get focus after something in foreground is clicked - android

Using Sencha Touch 2.0.1.1 and Cordova 2.0.0, I'm having trouble with the focus of elements.
In multiple situations, elements in the background gain focus after an element in the foreground disappears by a tap.
After an Ext.Msg.alert()'s OK button is clicked, the focus immediatly shifts to an underlying textfield behind the mask in the background
When clicking the slideButton on WNielson's facebook menu, the focus immediatly shifts to the searchfield that's 'below' the slideButton (https://github.com/wnielson/sencha-SlideNavigation)
When clicking a list item on WNielson's facebook menu, I get instantly get redirected to a link that's 'below' the menu.
This occurs on Android and iOS only, but not in Chrome on pc or iOS. I've tried disabling the background element/view until the foreground element is gone, but this doesn't seem to work.
Does anyone have a solution to this problem? Is this a bug in sencha touch?
Edit: I've uploaded an example on http://www.senchafiddle.com/full/!NxY8s/, view it with an android device, and see what I mean.

I've seen this behavior once, the problem was there were elements that were listening to click events instead of just tap events as generated by sencha.

Related

.NET MAUI Entry keyboard does not hide

I have a very simple UI that has one entry control to enter phone number and a button. The entry control has a handler for removing border around it. When the entry control got focus, keyboard pops up. But when I try to tap outside the entry control such as on the screen empty area, the keyboard does not dismiss and the entry control does not lose focus. Also since the button is at the bottom of the screen, therefore, the soft keyboard hides it and there is no way to tap the button. The button can only be tapped if I press the Android device back button.
At present, I have not checked this behavior on an iOS device.
This was not a problem in Xamarin Forms though. I searched a lot on Internet and found that it is currently a bug in MAUI.
I tried to attach a tap gesture on the parent layout control and invoked platform-specific code to hide the keyboard but it seems the entry does not lose focus and in turn the tap gesture event is never called.
However, the entry control should lose focus automatically when I tap outside the entry control (such as on the screen) and the soft keyboard should automatically dismiss.
Please provide a workaround if there is any.
Known bug. Removing the focus sometimes helps. Sometimes you need to do Disable/Enable in sequence. (I go with the second).
If you want, you can read this for example:
https://github.com/dotnet/maui/issues/12002
(Most disturbing part, considering this is know bug for half year+)
We can leave the behavior how this is for now in NET7 and provide an
API in NET8 that lets users toggle this behavior on/off for iOS and
Android

How to prevent Android's back gesture from selecting text inside of nested webview?

We have an app that uses a Webview to render a text editor (contentEditable) inside of a React Native application. This works well overall, except that the Android back gesture can lead to changes in the selection of text inside the Webview and similar strange behaviors.
We've tried things like having an element along the screen edge that pops out to overlay the Webview when a user begins a back gesture, tried with both onPress and onPressIn.
But by that time, it's already too late to evt.preventDefault() - and the text selection takes place even though the Webview is now covered by another element, I guess because it's technically still the same event that triggered the overlay. (Also tried evt.stopPropagation in desperation.)
Is there any way to prevent text selection within our Webview when a user uses the back gesture?

Clicking a textview in a Webview causes screen to jump and Webview scroll to become infinite

I am writing an app with the Salesforce Android SDK.
We have a custom website that is used for the login landing page that has a username and password field.
Clicking on the first field brings focus and keyboard as expected. Clicking on the second field (regardless of which is clicked first) causes the screen to jump up and down for half a second and then leaves the screen so that you can scroll infinitely, even beyond the background image. No matter how far you scroll the scrollbar is stuck at the top. However to scroll back up you have to scroll the same distance you scrolled down.
While this is from the LoginActivity from the Salesforce SDK, I have modified the file to show the action bar at the top.
What is causing this behavior and how can I make it stop, changing zoom controls in the webviews settings does not seem to help.
The same screen in iOS does not seem to have this same behavior.
Worth noting, the defect does not appear in the devices chrome browser.
The Class in Salesforce SDK
According to the Salesforce SDK
There is a ScrollView in a WebView. This shouldn't be necessary and may cause a problem such as the one you described. Changing the ScrollView to LinearLayout should fix the issue.

How to detect loss of accessibility focus with on-screen navigation buttons?

I'm looking at the Support4Demos from the Android SDK and I'm not sure if this is working as intended. Specifically, I'm referring to accessibility focus when using the Widget > Explore by Touch Helper demo. If I tap on one of the blue regions to give it accessibility focus then tap on the on-screen home button focus will switch to the home button. But if I tap on the same blue region as before nothing happens (but if I tap on the other blue region focus transfers from the home button). I'm testing this on a Kindle with on-screen navigation buttons.
Am I correct in assuming that focus should transfer back to the blue region? If so, what is the proper way to handle this? Presumably there would be a way to know that the user tapped on something outside of the app and in response to this I could clear state in the ExploreByTouchHelper but I'm not sure how I would go about that.

Stopping the Android Soft Keyboard flashing black switching activities

I'm working on an app and have a small problem when the soft keyboard is shown before switching activities. This happens when:
The user hits the search button
They enter a search term, view the search in a new activity and then return to the previous page
When the user returns to the previous page, a black box flashes where the soft keyboard was and then returns to normal
If the list is turned off or empty this problem never manifests. I have tried to enable caching of the listview children, hiding the listview when the activity pauses but to no avail. I would really appreciate any insight into why this might be occuring.
Thanks,
Laurence
Thought I'd follow up.
This problem was specific to pre Android 3.0 devices. On HC, ICS and JB this is no longer exhibited. As simple way to get around this on older versions of Android is to just change the windows background to match the color of your view. It still is blanked out but no where near as noticeable as black on white.

Categories

Resources