From a321ab9b91af7e87d6abc4a88ff2533f55be32a2 Mon Sep 17 00:00:00 2001 From: Francisco Hodge Date: Sat, 6 Oct 2018 02:23:38 -0400 Subject: [PATCH] onInit callback --- src/lib/components/Keyboard.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/lib/components/Keyboard.js b/src/lib/components/Keyboard.js index 46f449a7..555e54ba 100644 --- a/src/lib/components/Keyboard.js +++ b/src/lib/components/Keyboard.js @@ -223,6 +223,20 @@ class SimpleKeyboard { document.addEventListener("touchend", handler); } + onInit = () => { + if(this.options.debug){ + console.log("Initialized"); + } + + /** + * Caret handling + */ + this.handleCaret(); + + if(typeof this.options.onInit === "function") + this.options.onInit(); + } + render = () => { /** * Clear keyboard