Skip to content
This repository has been archived by the owner on May 4, 2022. It is now read-only.

Don't add keyboard-open to CSS if keyboard is already hidden #201

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion js/utils/keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ var wasOrientationChange = false;
*/
var KEYBOARD_OPEN_CSS = 'keyboard-open';

/**
* Timer that adds KEYBOARD_OPEN_CSS class to the body.
*/
var keyboardOpenCssTimer;

/**
* CSS class that indicates a scroll container.
*/
Expand Down Expand Up @@ -550,6 +555,7 @@ function keyboardWaitForResize(callback, isOpening) {
*/
function keyboardHide() {
clearTimeout(keyboardFocusOutTimer);
clearTimeout(keyboardOpenCssTimer);
//console.log("keyboardHide");

ionic.keyboard.isOpen = false;
Expand Down Expand Up @@ -621,7 +627,7 @@ function keyboardShow() {
ionic.trigger('scrollChildIntoView', details, true);
}

setTimeout(function(){
keyboardOpenCssTimer = setTimeout(function() {
document.body.classList.add(KEYBOARD_OPEN_CSS);
}, 400);

Expand Down