mirror of
https://github.com/hodgef/simple-keyboard.git
synced 2025-01-19 16:52:59 +08:00
Build update
This commit is contained in:
parent
e2669bd87b
commit
d72584b439
@ -1,6 +1,6 @@
|
||||
/*!
|
||||
*
|
||||
* simple-keyboard v3.1.29
|
||||
* simple-keyboard v3.1.30
|
||||
* https://github.com/hodgef/simple-keyboard
|
||||
*
|
||||
* Copyright (c) Francisco Hodge (https://github.com/hodgef) and project contributors.
|
||||
|
File diff suppressed because one or more lines are too long
1
build/types/components/Keyboard.d.ts
vendored
1
build/types/components/Keyboard.d.ts
vendored
@ -37,6 +37,7 @@ declare class SimpleKeyboard {
|
||||
candidateBox: CandidateBox | null;
|
||||
keyboardRowsDOM: KeyboardElement;
|
||||
defaultName: string;
|
||||
activeInputElement: HTMLInputElement | HTMLTextAreaElement | null;
|
||||
/**
|
||||
* 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.
|
||||
|
4
build/types/services/Utilities.d.ts
vendored
4
build/types/services/Utilities.d.ts
vendored
@ -133,6 +133,10 @@ declare class Utilities {
|
||||
* @param {boolean} moveCaret Whether to update simple-keyboard's cursor
|
||||
*/
|
||||
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
|
||||
*
|
||||
|
@ -408,15 +408,14 @@ class SimpleKeyboard {
|
||||
/**
|
||||
* EDGE CASE: Check for whole input selection changes that will yield same updatedInput
|
||||
*/
|
||||
if(this.utilities.isStandardButton(button) && this.activeInputElement){
|
||||
const isEntireInputSelection = (
|
||||
if (this.utilities.isStandardButton(button) && this.activeInputElement) {
|
||||
const isEntireInputSelection =
|
||||
this.input[inputName] &&
|
||||
this.input[inputName] === updatedInput &&
|
||||
this.caretPosition === 0 &&
|
||||
this.caretPositionEnd === updatedInput.length
|
||||
);
|
||||
this.caretPositionEnd === updatedInput.length;
|
||||
|
||||
if(isEntireInputSelection){
|
||||
if (isEntireInputSelection) {
|
||||
this.setInput("", this.options.inputName, true);
|
||||
this.setCaretPosition(0);
|
||||
this.activeInputElement.value = "";
|
||||
|
@ -302,7 +302,8 @@ class Utilities {
|
||||
/**
|
||||
* 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
|
||||
|
Loading…
Reference in New Issue
Block a user