32768

Screen Scrolls while typing Using JQTouch in an Android PhoneGap app?

Question:

I have made an app using JQtouch, Jquery, and PhoneGap. When you type in a form's field, the entire page scrolls up or down each time you enter a character. I have searched everywhere for solutions but cannot find one. There was a similar problem here: <a href="https://github.com/jquery/jquery-mobile/issues/638" rel="nofollow">https://github.com/jquery/jquery-mobile/issues/638</a> but his solution did not solve my issue.

Does anyone have an idea why the page would scroll up and down with each added character in a textbox? Because the page is so small, it scrolls up and down quickly making it very annoying.

Answer1:

Put the following CSS in your file after all other CSS styles:

body { -webkit-perspective: none; -webkit-transform-style: flat; } body > * { -webkit-backface-visibility: visible; -webkit-transform: none; }

This should solve your problem (at least it did for me).

Answer2:

Try this in an init function called onload :

function preventBehavior(e) { e.preventDefault(); }; document.addEventListener("touchmove", preventBehavior, false);

More discussion at <a href="http://groups.google.com/group/phonegap/browse_thread/thread/739525b7531b6d29/" rel="nofollow">http://groups.google.com/group/phonegap/browse_thread/thread/739525b7531b6d29/</a>

Answer3:

I faced the same issue on Android 2.2. I put the following properties in my CSS and then found that the issue had been resolved. What thing made the difference; I don't know, but it is working for me:

html, body{overflow: hidden;}

Try this, it may work for you also.

Answer4:

I'm using the new beta version (jqtouch-1.0-b4-rc), and with that I couldn't get these tricks to work on either Android 2.2 or 2.3. In the end I fixed it by including in the following at the base of my CSS:

#jqt ul li { -webkit-transform: none; position: relative; /* required to fix arrows */ } #jqt ul li a { -webkit-transform: none; }

Recommend

  • iOS two views cover exactly half of parent view
  • Eclipse dark color theme fixes
  • wrong item changes in recyclerview
  • How to expand parent div to account for child's overflow?
  • UIPickerView without IB?
  • Mercurial: Identify file name after rename
  • Avoid registering duplicate broadcast receivers in Android
  • C# List of Panels
  • How to handle elastic beanstalk deployment so it uploads only changed files
  • uml Composition relationships to RDF and OWL
  • Check all values in string[] for length?
  • Azure table store snapshot/backup capability
  • Adjust width of select element according to selected option's width
  • SharedPreferences or SQLite Database?
  • xtable package: Skipping some rows in the output
  • Java: can you cast Class into a specific interface?
  • If I include Java 8 in my Android app does that affect which devices it will work on?
  • Change JButton Shape while respecting Look And Feel
  • Using $this when not in object context
  • Display issues when we change from one jquery mobile page to another in firefox
  • Uncaught Error: Could not find module `ember-load-initializers`
  • Read text file and split every line in MSBuild
  • Different response to non-authenticated users and AJAX calls
  • C# - Serializing and deserializing static member
  • Align navbar back button on right side
  • AES padding and writing the ciphertext to a disk file
  • Java applet as stand-alone Windows application?
  • Updating server-side rendering client-side
  • Modifying destination and filename of gulp-svg-sprite
  • How to extract text from Word files using C#?
  • Arrow is showed instead of the material design version hamburger icon. Why doesn't syncState in
  • Run Powershell script from inside other Powershell script with dynamic redirection to file
  • Data Validation Drop Down Box Arrow Disappearing
  • Load html files in TinyMce
  • Error creating VM instance in Google Compute Engine
  • How can I get HTML syntax highlighting in my editor for CakePHP?
  • CSS Applying specific rule for a specific monitor resolution with only CSS is posible?
  • coudnt use logback because of log4j
  • Change div Background jquery
  • Programmatically clearing map cache