Build update

This commit is contained in:
Francisco Hodge 2021-06-09 05:05:50 +00:00
parent e2669bd87b
commit d72584b439
6 changed files with 15 additions and 10 deletions

View File

@ -1,6 +1,6 @@
/*! /*!
* *
* simple-keyboard v3.1.29 * simple-keyboard v3.1.30
* https://github.com/hodgef/simple-keyboard * https://github.com/hodgef/simple-keyboard
* *
* Copyright (c) Francisco Hodge (https://github.com/hodgef) and project contributors. * Copyright (c) Francisco Hodge (https://github.com/hodgef) and project contributors.

File diff suppressed because one or more lines are too long

View File

@ -37,6 +37,7 @@ declare class SimpleKeyboard {
candidateBox: CandidateBox | null; candidateBox: CandidateBox | null;
keyboardRowsDOM: KeyboardElement; keyboardRowsDOM: KeyboardElement;
defaultName: string; defaultName: string;
activeInputElement: HTMLInputElement | HTMLTextAreaElement | null;
/** /**
* Creates an instance of SimpleKeyboard * Creates an instance of SimpleKeyboard
* @param {Array} params If first parameter is a string, it is considered the container class. The second parameter is then considered the options object. If first parameter is an object, it is considered the options object. * @param {Array} params If first parameter is a string, it is considered the container class. The second parameter is then considered the options object. If first parameter is an object, it is considered the options object.

View File

@ -133,6 +133,10 @@ declare class Utilities {
* @param {boolean} moveCaret Whether to update simple-keyboard's cursor * @param {boolean} moveCaret Whether to update simple-keyboard's cursor
*/ */
addStringAt(source: string, str: string, position?: number, positionEnd?: number, moveCaret?: boolean): string; addStringAt(source: string, str: string, position?: number, positionEnd?: number, moveCaret?: boolean): string;
/**
* Check whether the button is a standard button
*/
isStandardButton: (button: string) => boolean | "";
/** /**
* Removes an amount of characters before a given position * Removes an amount of characters before a given position
* *

View File

@ -408,15 +408,14 @@ class SimpleKeyboard {
/** /**
* EDGE CASE: Check for whole input selection changes that will yield same updatedInput * EDGE CASE: Check for whole input selection changes that will yield same updatedInput
*/ */
if(this.utilities.isStandardButton(button) && this.activeInputElement){ if (this.utilities.isStandardButton(button) && this.activeInputElement) {
const isEntireInputSelection = ( const isEntireInputSelection =
this.input[inputName] && this.input[inputName] &&
this.input[inputName] === updatedInput && this.input[inputName] === updatedInput &&
this.caretPosition === 0 && this.caretPosition === 0 &&
this.caretPositionEnd === updatedInput.length this.caretPositionEnd === updatedInput.length;
);
if(isEntireInputSelection){ if (isEntireInputSelection) {
this.setInput("", this.options.inputName, true); this.setInput("", this.options.inputName, true);
this.setCaretPosition(0); this.setCaretPosition(0);
this.activeInputElement.value = ""; this.activeInputElement.value = "";

View File

@ -302,7 +302,8 @@ class Utilities {
/** /**
* Check whether the button is a standard button * Check whether the button is a standard button
*/ */
isStandardButton = (button: string) => button && !(button[0] === "{" && button[button.length - 1] === "}"); isStandardButton = (button: string) =>
button && !(button[0] === "{" && button[button.length - 1] === "}");
/** /**
* Removes an amount of characters before a given position * Removes an amount of characters before a given position