From 78c081428b5f0b8e8df15447e655149e1e9b5b80 Mon Sep 17 00:00:00 2001 From: Tim Lancina Date: Thu, 11 Jun 2015 18:07:10 -0500 Subject: [PATCH] docs(keyboard): clarify hide on keyboard open --- js/utils/keyboard.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/js/utils/keyboard.js b/js/utils/keyboard.js index 2d29c99df5c..6045c567e44 100644 --- a/js/utils/keyboard.js +++ b/js/utils/keyboard.js @@ -27,6 +27,20 @@ *
* * ``` + * + * Note: For performance reasons, elements will not be hidden for 400ms after the start of the `native.keyboardshow` event + * from the Ionic Keyboard plugin. If you would like them to disappear immediately, you could do something + * like: + * + * ```js + * window.addEventListener('native.keyboardshow', function(){ + * document.body.classList.add('keyboard-open'); + * }); + * ``` + * This adds the same `keyboard-open` class that is normally added by Ionic 400ms after the keyboard + * opens. However, bear in mind that adding this class to the body immediately may cause jank in any + * animations on Android that occur when the keyboard opens (for example, scrolling any obscured inputs into view). + * * ---------- * * ### Plugin Usage