Android browser / Samsung Galaxy SII scrolling bug on web forms. Select list hitboxes don't scroll - html

EDIT: I've uploaded a video to youtube demonstrating the bug here: http://www.youtube.com/watch?v=zkDYlgtX5Hk
I've got a really weird bug that I found testing my new web application on a Samsung Galaxy S2 running Android 4.03 ICS.
What happens is that when you load a form in the default web browser and then scroll down the page, the hitbox/touchable area seems to stay where it was on screen when the page first loaded, even though the form element itself has scrolled up the screen.
As far as I can tell with the few testing devices I have available, I think this only happens on the Samsung Galaxy S2 as I have tried it in the Android simulator with the same version of android and was unable to replicate the problem. I know this makes it a very specific user base that haves the problem however last I checked the Galaxy s2 was the most popular Android handset in my country (Australia) so it would be nice to find a fix.
I have created a very simple page to demonstrate this at http://users.tpg.com.au/geoffica/test.html
You can replicate the problem by doing the following:
Load the page on a Galaxy S2
Scroll the browser so that page completely fills the screen and the address bar is just off the top of the screen.
Where the select box is, place your finger to the side of the screen as a marker of where the select list was.
Scroll down the page any distance, (while still keeping the select list on screen) then touch the whitespace where the select list used to be and the options should come up on the screen. It may take a few attempts to get it but it will happen.
Now I know you are thinking this is quite tricky to replicate and likely rare that it will happen, but on a form I built for a client because of where the elements were positioned, the hitbox always overlapped the submit button of the form, making it very difficult to hit the submit button. Select lists will also steal touches from other select lists if the hitboxes overlap, making the wrong options appear when touched.
I've tried many things but the only workaround I've found so far is to use the touchstart event to trigger my submit button instead of the click event. This seems to happen before the click event of the select lists and prevents it from getting in first, but this is far from ideal and doesn't stop the select lists from stealing clicks from other elements on the page.
I've also thought about rolling my own jquery plugin to maybe place the select lists offscreen and then trigger their click events by touching a link or something. If it's a mobile device then the options will come up on screen regardless of the position of the select list. This would be quite cumbersome however and I would need to factor in the effect this would have on users coming from a pc or iPad for example which shows the options in a dropdown list instead. It sounds pretty problematic to me. May even require some Galaxy s2 specific browser/device sniffing.
Does anyone have a real workaround for this, apart from just not using select lists?

Are you by any chance using absolute positioning for it? this will fix to a certain area on the screen not the page.

First, I would update the document header to a proper HTML5 header:
<!DOCTYPE html>

I think this might be a problem you can fix With Jquery-mobile
Just simple because when you do not use it , you website look very weird on mobile Browsers
May be this is the solution and this is just a hint :)

Related

How can I get the Android soft keyboard to overlay my website?

I have a problem that seems pretty simple to me, but so far it was impossible to find a simple solution: On my website, whenever the Android soft keyboard pops up, it resizes the window and shrinks the content, instead of just overlaying the page.
See these pictures for reference:
The first two are the current situation, the third is what I want. It works like this on iOS. What can I do to make it work that way?
The screenshots were taken in Firefox - this is a website based on HTML, not a native app.
I tried setting body size and position, but so far, no luck. I've seen some very complicated JS code snippets for similar problems, but I didn't get any of them to work the way I want, and it also seems like there should be an easier way around it. The sizes of all the elements are determined with vh and wv. Setting fixed pixel values seems like it would kill the responsiveness of the design, no?
I'm not a very experienced developer, my page is just very basic HTML and CSS. Is there a way to achieve what I want with only that?
On your manifest.xml you can set android:windowSoftInputMode to adjustPan.
<activity
android:name=".WebActivity"
android:windowSoftInputMode="adjustPan" />
From Android documentation:
Don't resize the window to make room for the soft input area; instead
pan the contents of the window as focus moves inside of it so that the
user can see what they are typing. This is generally less desireable
than panning because the user may need to close the input area to get
at and interact with parts of the window

How do I get a dropdown menu that uses hover to work on touchscreen?

This is my website for a school project, it is designed to be viewed on a phone. I have a dropdown menu on it near the top that uses hover, which does not work on touch devices. I need to make this work with clicking (I don't really care if hover still works, I need to click) but do not know how. How do I make this work with tapping on a touchscreen? I really want to stay away from javascript for now and just use HTML and CSS. I am very new to webdesign so I will need a very basic explanation. Also I know my images take a long time to load, any suggestions on how to address that would also be appreciated.
Thank you!
Most touch devices lack the ability to provoke a true hover interaction (some exceptions would be the Samsung Galaxy Note with pen, Microsoft Surface devices with pen, and the iPad Pro with pen).
That said, touching an element that has a :hover pseudo selector with associated styles (as you do) should invoke that hover event, even in mobile browsers on touch devices.
Have you viewed your website on a touch device? The menu appears as expected with tapping on my Google Pixel (with Chromium browser) as well as on my Surface device in tablet mode.
There may be some browsers/devices or combinations thereof that do not exhibit this behavior, but I believe it's quite standard.
If you need a more principled solution, I'd suggest making the nav toggle a <button> element and executing some basic JavaScript on click events. I realize you don't want to stray into that territory right now, but that's exactly the sort of use case at which JavaScript excels.
If you really want to avoid JavaScript and you don't like relying on the touch-invokes-hover-event approach, there's always the checkbox hack. As the name indicates, it's a hack. I wouldn't recommend it for your particular use case. But to each his/her own.
Here's a CSS Tricks article on all the interesting uses the checkbox hack can be applied to.

Translate-Z Mixing Order only Mobile

I'm having a weird problem with a website we are developing. This site has a parallax effect in it, and it's implemented without JavaScript using only translate z and scale (you can check this in http://keithclark.co.uk/articles/pure-css-parallax-websites/)
The problem we are having is that in chrome for desktop the site seems to be ok (you'll see the problem on the second picture):
But when I turn "devide mode" on, this is what I see 90% of the times (also in mobile and also, most of the time, but not all the times):
As you can see, the slider above "DESTACADOS" is gone, but if I click any button, or execute any action (click on button or link), the slider appears again.
The problem is kind of hard to pinpoint, so ask for whatever clarification or specification you need.
Thanks in advance.
EDIT 1:
I have tried to make some small example but I couldn't. It works fine for each part but not on the whole.
This is the full site:
http://192.185.67.199/~arielces/animations/#/commerce/main
Another thing I've noticed is that when in device mode, if you search the div with the magnifiers or just move the console from bottom to right, the content shows.

Sencha Touch list scrolling while soft keyboard is up

I'm building a mobile app that lives inside of a UIWebView and is written in sencha.
Right now, I have a page that has a ext.list containing <textarea> element inside of the rows.
When the user clicks on the text area, the soft keyboard comes up and pushes the screen as expected. However, if you try to scroll the list while the keyboard is up, the list will dart all the way down to the bottom. At this point, you can try to scroll the list back up to see the <textarea> (keyboard still up), but whenever you're done scrolling and remove your finger it will immediately stick you down at the bottom of the list again.
Once you dismiss the soft keyboard, the problem goes away. We want scrolling with the keyboard up, unfortunately.
Things I've tried:
*Use the scrollstart event to unfocus the <textarea> and dismiss the keyboard when scrolling begins works, but like I said, we want scrolling with the keyboard up
*Put the <textarea> on a toolbar, or just plain fix it to the middle of the screen. It doesn't seem to care where the <textarea> is. The main problem seems to be the keyboard + scrolling interactions.
I've looked around for some time now and cannot find anything on this. It seems most people are complaining about Android, which I haven't even explored yet. I feel like this has got to be something people are incorporating into their apps, though (like a search that displays results while you type and you can browse those results), so I must just be missing something? Does Sencha 2 fix this?
Thanks in advance. I can post code and/or a demo as per request.

Link selection on Opera Mini 4.2 acting strangely

I'm developing a mobile site in HTML for use on 2 Blackberry models, one quite old (8700v) and one newer (8520) as specified by the client.
The native browser on the 8520 is rendering my HTML/CSS pages perfectly. The native browser on the old 8700 is far from perfect however as the CSS support is minimal.
As a solution I decided to try installing Opera Mini 4.2 on the 8700. The rendering is great, speed is even improved but there's some rather strange behaviour happening with the hyperlinks on the page.
When I scroll down through my pages links are automatically highlighted and made ready for selection. This is fine until I have a number of links close together, for example in my nav menu. The nav menu is a set of links arranged within a . When I scroll to the menu all the links within the menu highlight at once. Even within the body if 2 links are on 2 separate lines (one stacked on top of another) the same issue appears.
I'm trawling Opera documentation but haven't found anything useful yet. Anyone got any ideas on why this happens and if it can be resolved?
Without seeing the actual HTML/CSS code, it's hard to pinpoint the exact cause of this, but it's most likely one of the following:
The links in question point to the same URL. The browser will highlight them as a group to visualize this.
Some script is adding a click event listener or similar to the group of links.
An <a>-tag has been left open.