Skip to content

Commit

Permalink
fix: type when element.maxLength is -1 (#263)
Browse files Browse the repository at this point in the history
  • Loading branch information
pomber committed May 8, 2020
1 parent f15bec6 commit 2a3d774
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.js
Expand Up @@ -217,7 +217,8 @@ const userEvent = {
};
const opts = Object.assign(defaultOpts, userOpts);

const computedText = text.slice(0, element.maxLength || text.length);
const computedText =
element.maxLength > 0 ? text.slice(0, element.maxLength) : text;

const previousText = element.value;

Expand Down

0 comments on commit 2a3d774

Please sign in to comment.