I have an issue on my phone running Android 4.0.4.
I have an iframe with a text field and a couple of dropdowns, but the iframe is too wide to fit in the phone window when in portrait mode, so I get a horizontal scroll bar so I can scroll to see all of the fields.
The problem is, if I scroll the iframe to the right I can no longer select the text box or the dropdowns.
It looks like the device doesn't realise the iframe has been scrolled to the right, so for example, when the iframe first renders, the content is positioned left aligned. At this moment, one of the dropdowns is visible at the far right of the iframe. If I scroll the iframe all the way to the right and tap the screen where the dropdown used to be, I get the selection screen for the drop down even though the area of the screen I actually clicked had no element on it at all.
If I tap the screen where the dropdown actually is, I get no response at all.
I have a test page here:
http://snow.x10.mx/damian/page.html
Everything works fine on Firefox on the desktop, so it looks like it may be just an Android bug.
Can anybody suggest a workaround for it (other than making sure the iframe isn't wider than the screen) because I can't see an Android fix coming any time soon!
If anyone has an iPhone they can test it with, can you let me know if you have the same problem?
I've run into the same issue with Android 4.0.4
The same thing happens with vertical scrolling, and applies to input fields, links... Anything that should react to a touch/click event. If the element is visible before scrolling the position where it was is still reacting to the touch event after scrolling. And if it's not visible before scrolling there is nothing you can do to interact with that element.
I'm not sure what's causing this, but using a scrollbar plugin ( jScrollPane ) has solved it for me.
Good luck!
Related
i have a webapp i'm trying to make responsive and i'm running into a problem on my Android 5.2 phone where when i click the input, it shows the keyboard and the form gets pushed down i think, leaving this ugly white area at the bottom whenever the keyboard is shown.
I'm using 100vh on the element that contains the background image, could that be what's causing the problem?
I'll link an image of the issue below taken from my mobile phone.
Has anyone run into this issue before? how did you fix it?
Use this for small screen devices :
body{
-webkit-box-sizing:border-box;
box-sizing:border-box;}
Rookie mistake, you must shouldn't use vh for heights, just let the content define the height and if necessary define min-heights, vh messes it up on Mobile whenever you scroll down.
I have a responsive web page that I want to reorder with jquery when going from one size to a smaller one. Everything is great except when I reorder an element (a DIV, for example) that has an input in it, like the search form:
$( '#searchfrm' ).insertAfter( '#bodyfrm' );
If I do this, when I click the input, the keyboard appears for a second and then disappears. This happens only on Android, on iPhone it works perfectly.
If I comment the code line, the input works perfectly on Android but I don't want the search form on top, but on the bottom of the page on the responsive design.
How do I prevent this from happening? Thanks!
I found that the problem was when reordering the elements. The reordering process was being done all the time so, in Android, when the keyboard appeared, jquery was reordering again, making the keyboard disappear. The solution was adding a variable in jquery to prevent the reordering process all the time and do it only once when going from 1024 to 700, for example.
I had a similar issue but found it was due to the $(window).on("resize",function(){...}); and not the .insertAfter script used to reposition the element.
If the element you reposition has an input field and that input field is in focus ~ the default behavior of Android opening the keyboard actually resizes the browser causing the function to loop. - REFERENCE: (dealing-androids-constant-browser-resizing). Changing the function to trigger on (load) as opposed to (resize) did the trick for me. $(window).on("load",function(){...});
I got a problem with Bootstrap's fixed menu bar.
Works fine on Desktop browsers, but on phones (especially on Android phones) the menu bar behaves weird.
The logo is not always present on a page load, and when you wipe over the position where it is supposed to be, it suddenly shows up. Also when changing the orientation to landscape, the toggle/collapse button is lost somewhere in the middle of the nav bar, and doesnt stay on the right side anymore.
It seems like fixed bars on Android are buggy...and the rendering is messed up somehow...
Has anybody seen the same weird behaviour before? Is there a good fix?
Found a dirty workaround, that somehow forces the android browser to rerender the elements mentioned above:
$("#navbar .logo img").width(31).width(32);
$("#navbar .logo img").height(31).width(32);
$("#navbar").hide();
$("#navbar").get(0).offsetHeight;
$("#navbar").show();
Obviously this code is rather silly ;) but it works...since it comes down to small css adjustments which are reversed right away, there might be a smarter solution to force a rerendering. However having the browser measure the offset of at least one of the involved elements seems to be crucial...
I have a ScrollView with 20 WebViews inside (yes, I know it's heavy but right now it's the best solution I've found). The WebViews are used to display forum posts.
I'm getting a very weird behavior on my Nexus 4 (it doesn't happen on some other devices I've tested) which is driving me crazy.
I have the first post visible and just a little bit of the second one visible. Now I want to scroll and instead of starting scrolling by putting the finger in the first post I put the finger on the portion of the second post that is visible. The WebView of that second post immediately jumps to the bottom which is a very annoying behavior while scrolling.
If you feel appropriate I can record a video of this behavior and upload to YouTube or you can search for AndroidPIT in the Play Store and check the behavior yourself in the Forum section. I won't post the link to the Play Store to avoid being called a spammer.
Thanks in advance.
From comment: "Have you tried setting your webview to non focusable and non clickable as it appears as it's trying to display the entire content of the item you are pressing on as you scroll"
Apparently View#setFocusable (view.setFocusable(false)) worked.
Make sure that the scrolling is handled by the scrollview in stead of the webview. I believe setting the Webview.canscrollvertically to false might fix the problem, let me know if it helped.
When you have some clickable content like <a>, <input> or <area> and before this you have an absolutely positioned element with a bigger z-index, there is the wrong behavior of 'click-through'.
I click on the area where the clickable element is behind the front element. In other browsers there is the right behavior that the click does not go through the front element. But only in Android Browser you can click through the front element and activate the element behind. This is a known bug and you cannot avoid it. It's even in newer versions (I test on 2.3.3 in the official Android emulator).
There are some workarounds described in some forums but none of them worked for me.
I tried to put an <iframe> or an <a> between front and back
I tried to change the DOM so maybe the browsers state is refreshed
I tried to have the back elements be positioned as well
None worked
I'm especially having problems with the image map's area elements.
Has anyone had the same issue and managed to work around it?
I'm specifically interested in solutions which are tested against image maps.
I am wondering about a few things here. First, what is the purpose of having an overlaid image and using the image maps? I see you're including jQuery - can you use the hover event with jQuery to change the orientation of the images and do the swap? What about attaching to the click event for the image map, and checking to see if the lightbox is open. If it is, then return false;.
Just trying to think out loud. Sometimes another take on it can be helpful.
This is a quick blindfolded reply, so let me know if I should expand/fix it further. The general idea being a CSS class for both the hover and focus events that disables pointer interaction.
yourElementClass:focus, yourElementClass:hover {
pointer-events: none;
}
Actually I've managed to avoid it by moving the objects below to let them be not visible.
But in cases similar to yours the only workaround that actually works is to manage all the clicks in jquery (especially the ones on the background) and to bind/unbind the clicks events on needs.
there are also some things that could help on some version/mobiles (but do not solve the problem)
the above item has background:rgba(0,0,0,0.1);
you should put a gif or png as background of the above element (as well as the background color as point 1)
using thouchstart instead of click as bind event sometimes helps.
the actual version of android/browser are not affected with this bug (or at least it never happen to me) but it could be nice to know the affected versions. If someone has a list.