Skip to content

Commit

Permalink
Fix Delay Too Fast
Browse files Browse the repository at this point in the history
  • Loading branch information
taufik-nurrohman committed Oct 8, 2023
1 parent fbd1b76 commit b8d6b6d
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 71 deletions.
10 changes: 5 additions & 5 deletions .github/factory/index.js.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -406,15 +406,15 @@ function TP(source, state = {}) {
function onCopyCutPasteTextCopy(e) {
let type = e.type;
if ('copy' === type) {
delay(() => letTextCopy(1))();
delay(() => letTextCopy(1), 1)();
} else if ('cut' === type) {
!sourceIsReadOnly() && setTags("");
delay(() => letTextCopy(1))();
delay(() => letTextCopy(1), 1)();
} else if ('paste' === type) {
delay(() => {
!sourceIsReadOnly() && setTags(textCopy.value);
letTextCopy(1);
})();
}, 1)();
}
delay(() => {
let tags = $.tags;
Expand Down Expand Up @@ -564,7 +564,7 @@ function TP(source, state = {}) {
}
offEventDefault(e);
}
})();
}, 1)();
// Focus to the first tag
if ("" === theValue && KEY_BEGIN === key) {
if (theTag = getChildren(textOutput, 0)) {
Expand Down Expand Up @@ -635,7 +635,7 @@ function TP(source, state = {}) {
});
}
setValue("");
})();
}, 1)();
}

function onSubmitForm(e) {
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright © 2022 Taufik Nurrohman <https://github.com/taufik-nurrohman>
Copyright © 2023 Taufik Nurrohman <https://github.com/taufik-nurrohman>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
Expand Down
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta content="#000" name="theme-color">
<meta content="width=device-width" name="viewport">
<meta content="Better tags input interaction with JavaScript." name="description">
<title>Tag Picker 3.4.17</title>
<title>Tag Picker 3.4.18</title>
<link href="index.min.css" rel="stylesheet">
<style>
* {
Expand Down Expand Up @@ -76,7 +76,7 @@
<body>
<p role="alert">Do you like this project? Please support my <a href="https://github.com/mecha-cms">Mecha CMS</a> project too. Thank you!</p>
<header>
<h1>Tag Picker 3.4.17</h1>
<h1>Tag Picker 3.4.18</h1>
<p>Tag Picker is a simple JavaScript application that aims to provide better experience for users in adding and removing comma-separated list of words.</p>
<hr>
</header>
Expand Down Expand Up @@ -372,7 +372,7 @@ <h2>License</h2>
</main>
<footer>
<hr>
<p>&copy; 2022 <a href="/">Taufik Nurrohman</a></p>
<p>&copy; 2023 <a href="/">Taufik Nurrohman</a></p>
</footer>
<script src="index.min.js"></script>
<script>
Expand Down
Loading

0 comments on commit b8d6b6d

Please sign in to comment.