Adding types for disableCaretPositioning option

This commit is contained in:
Francisco Hodge
2019-01-16 19:38:42 -05:00
parent 23a50e6f44
commit 6c2236f762
9 changed files with 17 additions and 6 deletions
+5
View File
@@ -101,6 +101,11 @@ declare module 'simple-keyboard' {
*/
useButtonTag?: boolean;
/**
* A prop to ensure characters are always be added/removed at the end of the string.
*/
disableCaretPositioning?: boolean;
/**
* Executes the callback function on key press. Returns button layout name (i.e.: "{shift}").
*/
+1
View File
@@ -59,6 +59,7 @@ class SimpleKeyboard {
* @property {function} onInit Executes the callback function once simple-keyboard is rendered for the first time (on initialization).
* @property {function(inputs: object):object} onChangeAll Executes the callback function on input change. Returns the input object with all defined inputs.
* @property {boolean} useButtonTag Render buttons as a button element instead of a div element.
* @property {boolean} disableCaretPositioning A prop to ensure characters are always be added/removed at the end of the string.
*/
this.options = options;
this.options.layoutName = this.options.layoutName || "default";