From 85d5922d2dfdeb4face5dd2cc0544b32a1423b20 Mon Sep 17 00:00:00 2001 From: "E. Kondratiev" Date: Thu, 7 Nov 2024 13:53:05 +0300 Subject: [PATCH] on passte handler fixed --- ws.htm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ws.htm b/ws.htm index 91145e8..5f080bb 100644 --- a/ws.htm +++ b/ws.htm @@ -144,7 +144,9 @@

Character Code Detector

sourceElement.focus(); sourceElement.addEventListener ('change', textChanged); sourceElement.addEventListener ('keyup', textChanged); - sourceElement.addEventListener ('paste', textChanged); + sourceElement.addEventListener ('paste', function(e) { + setTimeout (function() { textChanged(); }, 0); // the paste event fired BEFORE the element content is updated, so the call is delayed + }); if (urlParams.t !== undefined) { // process the url parameter