Do not show tag tooltip when typing

This commit is contained in:
Lucas Sköld
2025-02-06 01:05:38 +01:00
parent 65ecbf0a44
commit 9d92e5bdf4
+19
View File
@@ -49,8 +49,27 @@ function enhanceTextarea(textarea) {
let currentTooltipTag = null;
let tooltipTimeout = null;
let isTyping = false;
let typingTimeout = null;
textarea.style.background = "transparent";
// Add input handler for typing state
textarea.addEventListener("input", () => {
isTyping = true;
if (typingTimeout) {
clearTimeout(typingTimeout);
}
typingTimeout = setTimeout(() => {
isTyping = false;
}, 1000); // Reset typing state after 1 second of no input
});
textarea.addEventListener("mousemove", (e) => {
if (isTyping) {
return;
}
// Clear existing timeout
if (tooltipTimeout) {
clearTimeout(tooltipTimeout);