Skip to content

Commit

Permalink
Check if cursor is in a form field before triggering animation
Browse files Browse the repository at this point in the history
  • Loading branch information
jennie committed Feb 6, 2024
1 parent 86d39d9 commit 3a9b6a3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions twine_src/scripts/2.init.js
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,14 @@ $(document).ready(function () {
var split;

document.addEventListener("keydown", function (event) {
if (
event.target.tagName === "INPUT" ||
event.target.tagName === "TEXTAREA" ||
event.target.tagName === "SELECT"
) {
return;
}

if (event.code === "Space" && split) {
split.revert();
gsap.to(split.words, { autoAlpha: 1, duration: 0 });
Expand Down

0 comments on commit 3a9b6a3

Please sign in to comment.