Merge pull request #285 from vickylance/master

Changed the condition to >= to check for character string inputs like ".com"
This commit is contained in:
Francisco Hodge 2019-10-29 08:12:24 -07:00 committed by GitHub
commit 7206558540
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -304,7 +304,7 @@ class Utilities {
let options = this.getOptions(); let options = this.getOptions();
let maxLength = options.maxLength; let maxLength = options.maxLength;
let currentInput = inputObj[options.inputName]; let currentInput = inputObj[options.inputName];
let condition = currentInput.length === maxLength; let condition = updatedInput.length - 1 >= maxLength;
if ( if (
/** /**

View File

@ -379,7 +379,7 @@ it('Keyboard handleMaxLength will work with numeric maxLength', () => {
let output = keyboard.utilities.handleMaxLength(keyboard.input, "testq"); let output = keyboard.utilities.handleMaxLength(keyboard.input, "testq");
expect(output).toBeFalsy(); expect(output).toBe(true);
}); });
it('Keyboard handleMaxLength wont work with non numeric or object maxLength', () => { it('Keyboard handleMaxLength wont work with non numeric or object maxLength', () => {
@ -490,4 +490,4 @@ it('Keyboard camelCase will work with empty strings', () => {
testUtil.setDOM(); testUtil.setDOM();
let keyboard = new Keyboard(); let keyboard = new Keyboard();
expect(keyboard.utilities.camelCase()).toBeFalsy(); expect(keyboard.utilities.camelCase()).toBeFalsy();
}); });