Skip to content

Commit

Permalink
Fix length check so you can paste strings equal to max length
Browse files Browse the repository at this point in the history
  • Loading branch information
amstilp committed Mar 22, 2024
1 parent 40f1270 commit 6337e92
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion primed/static/js/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
const checkPasteLength = (e) => {
var paste = (event.clipboardData || window.clipboardData).getData("text");
maxlength = e.target.getAttribute("maxlength");
if (maxlength <= paste.length) {
if (paste.length > maxlength) {
alert("String longer than allowed maximum length of " + maxlength + " characters:\n" + paste)
e.preventDefault()
e.stopPropagation()
Expand Down

0 comments on commit 6337e92

Please sign in to comment.