I am currently developing an HTML5 application using PhoneGap version 2.5.0.
One issue I have encountered is related to the virtual keyboard behavior on different parts of the app. On the search page, the keyboard appears without obstructing the view, allowing me to still see the footer above it.
However, in other sections like a dialog box, the keyboard covers part of the screen, potentially blocking some fields.
All elements in the app are positioned as "absolute" rather than "fixed" to ensure they stay in place when the keyboard appears.
I am unable to determine why the keyboard behaves differently across various sections of the app. Any insights into this would be greatly appreciated.
Here is the relevant HTML:
<body>
<div role="dialog" id="details">
<div class="popup-content">
<header>
<h1 role="heading">Details</h1>
</header>
<article>
<div class="content">
<div class="label">Some Title</div>
<div id="dynamic_form">
<form><!-- dynamically filled form --></form>
</div>
</div>
</article>
<footer>
<ul class="footer-nav-buttons">
<li><a>Back</a></li>
</ul>
</footer>
</div>
</div>
<page id="search">
<header>
<h1>Search</h1>
</header>
<article class="page-content">
<div class="ui-header">
<input name="searchterm" id="searchtermtextbox" value="" type="text">
</div>
<article>
<div id="searchresultscontainer"></div>
</article>
</article>
</page>
<footer>
<ul class="footer-nav-buttons main-navigation-bar">
<li><a href="#menu" role="menuitem" class="button-menu"></a></li>
<li><a href="#contacts" class="button-contacts"></a></li>
<li><a href="#search" class="button-search"></a></li>
</ul>
</footer>
</body>
Below is the relevant CSS code, which may require further optimization for visual styling purposes:
body { margin: 0; position: absolute; height: 100%; width: 100%; }
page { position: absolute; top: 0; bottom: 0; left: 0; right: 0; display: none; }
page.selected { display: block; }
page>header { position: absolute; top: 0; left: 0; right: 0; height: 1cm; }
page article { position: absolute; top: 1cm; left: 0; bottom: 15mm; right: 0; }
div[role='dialog'] div.popup-content footer { position: relative; }
div[role='dialog'].visible { opacity: 1; z-index: 100; }
div[role='dialog'].active { display: -webkit-box; display: box; -webkit-box-align: center; }
div[role='dialog'] div.popup-content article { position: relative; }
div[role='dialog'] div.popup-content article div.content { position: relative; }
body>footer { position: absolute; bottom: 0; left: 0; right: 0; height: 15mm; }
ul.footer-nav-buttons { position: relative; display: -webkit-box; display: box; -webkit-box-align: center;
box-align: center; -webkit-box-pack: center; box-pack: center; list-style: none;
height: 100%; width: 100%; padding: 0; margin: 0;
-webkit-margin-before: 0;-webkit-margin-after: 0; -webkit-margin-start: 0;
-webkit-margin-end: 0; -webkit-padding-start: 0; }
ul.footer-nav-buttons li a { margin: 5px; }