The android web browser and its interactive virtual keyboard

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; }

Answer №1

To tackle this troublesome android issue, one effective method is to leverage the focus and blur events on input fields.

If utilizing jQuery:

$("input").focus(function(){
    $('footer').hide();
});

$("input").blur(function(){
    $('footer').show();
});

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Tips for repositioning my sidebar using CSS and HTML

I'm a beginner in CSS and HTML and I'm struggling to make my sidebar move to the side on my website. I have divided my site into three div areas: one for the 'sidebar', one for the 'main content', and one for both called &apos ...

Using HTML and C# to Deliver Emails

I've encountered a challenge with my HTML page that includes a textbox for users to input their email. When the submit button is clicked, an email should be sent to a specific email address defined in the code, and a pop-up box indicating "Email Sent" ...

JavaScript vs. markup: deciding between generating an extensive list of options or including them directly in

Recently, I encountered an issue with a .NET page that included a large number of identical dropdown lists within a repeater. Unfortunately, the rendering performance of the website was below expectations. In an attempt to improve the performance, I exper ...

The BottomNavigation component in MUI has a minimum size limit of 400px when it displays 5 items

My issue involves a bottom navigation bar with 5 elements. When the window is resized to less than 400px, the bottom navigation does not shrink, instead maintaining a minimum width of 400px and causing a scrollbar to appear on the x-axis. You can view a m ...

Restrict modifications in Sharepoint 2013 to text only

Can content editors be restricted to only adding text on websites? I want to prevent them from using inline styling in HTML or buttons in the editor to add styles. I'm dealing with a few rebellious editors who like to get creative with colors and sty ...

Achieving perfect alignment: Centering text within a div with an aspect ratio

I have encountered a situation where I need to center text within a div that also has an aspect ratio. Since the aspect-ratio property is not supported by major browsers like Safari, I am looking for an alternative solution. Here is my current code: .a ...

Ways to center card components (rmwc) horizontally within a React application

Within my parent component: { this.state.projectList.map(data => <Item details = {data}/>) } Inside the child component Item render() { return ( <div style={{'width':'100%', 'tex ...

While focusing on developing an Android app, Facebook decided to also submit its iOS app for review

We are in the process of developing an app for both iOS and Android platforms. Currently, the development progress on the iOS app is more advanced compared to the Android app. Our authentication method requires Facebook login, along with the need for "publ ...

Updating the correct list item in an unordered list on a Bootstrap modal pop-up submission

I am dealing with an unordered list of messages where each message within a list item is clickable. <ul id="home-message-list" class="messages"> <li> <a href="#"> <span class="linkClick" name="message">< ...

Whenever a query is made on a table in a Database Class using ORMLITE, the @ForeignCollectionField will be null

Here's a DB table example: @DatabaseTable(tableName = "Menus") public class Menus { @DatabaseField(columnName = "menuId", id = true) private String id; @ForeignCollectionField(eager = true) private ForeignCollection<Test> test;} This is the ...

What are the reasons for my HTML page not appearing on the local host within Google App Engine?

Below is the main.py file along with the html file intended to be rendered by the Jinja2 template being utilized: main.py import os import webapp2 import jinja2 from google.appengine.ext import db template_dir = os.path.join(os.path.dirname(__file__), & ...

Maximizing the Width of a Background Image in Wordpress Elementor for a Full Screen Effect

UPDATE: Issue Resolved! See the comments for details. Thanks to the helpful Dev! I'm facing a challenge with my website's homepage design. I'm trying to incorporate a background image that spans the full width of the screen. My website is b ...

How can I add an emoji picker button to a textbox?

Is there a way to incorporate an emoji picker button within a text box for selecting emojis without using jQuery, only utilizing CSS and core JavaScript? I am looking to implement an emoji picker similar to WhatsApp that allows users to insert emojis dir ...

I am struggling to understand why clicking this button is not successfully submitting the form to Google Sheets

I am facing an issue with my Google Sheet setup that collects form data from my website. The problem is, I am unable to link the event to a button that already exists ('CompleteOrder'). Strangely, it works perfectly fine if I add a new button: & ...

The parent DIV has a height of 0px, yet the child element is still visible

As I explored options for creating a navbar drop down menu with an accordion effect, I stumbled upon this informative YouTube video. The tutorial demonstrated the use of a custom component and manipulation of the max-height property of the card-content ele ...

Is it possible to utilize a tracking pixel (invisible GIF) as a background image within a stylesheet?

I'm curious to know if adding a tracking pixel (a transparent GIF with server logging) as a background-image in a linked stylesheet will have the same impact as if it were a regular <img> on a webpage. After conducting a quick test using Chrome ...

Delayed response of text effects in JQuery on page load

Within my rails app, I have the following code snippet: window.onload = -> $("#mycontainer").typewriter() $("#div1").fadeIn("slow") This code snippet interacts with the following block of content: <blockquote class="pull-left"> < ...

Collapsed on Load Vertical Collapsible Panel - Initially hidden panel on page load

Is there a way to load a <div> already collapsed when the page first loads? You can find my progress so far in this JS Fidle. HTML <button id="aa">Toggle it up</button> <div id="test">TEST</div> CSS div { background ...

Error in browser caused by JQuery JavaScript, not Dreamweaver

I need help creating a webpage that can extract and display recent earthquake data based on user input location on Google Maps. I have been using Dreamweaver to test my code, and everything functions perfectly when I use the live webpage feature within th ...

What is the method for designing a relative layout that organizes elements horizontally?

Can you tell me why elements are typically arranged vertically in a column? Is it feasible to change their orientation and display them horizontally, like in a row instead of a column? ...