From d26e646a94642cea0decf1d0a7e359a141c76e8f Mon Sep 17 00:00:00 2001 From: patriceac <48073125+patriceac@users.noreply.github.com> Date: Mon, 13 Mar 2023 22:07:55 -0700 Subject: [PATCH] Refresh the image count as user types (#936) * Refresh the image count as user types Currently I have to change the focus for the image count to refresh. This change makes it immediate. I've been wondering if 'change' should merely be replaced by 'keyup' but decided against it for accessibility reasons (people who might be using accessibility tools with alternative input methods). * Add a debounce Setting a debounce of 300ms on keyup. --- ui/media/js/main.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/media/js/main.js b/ui/media/js/main.js index 59d474f8..e3d35283 100644 --- a/ui/media/js/main.js +++ b/ui/media/js/main.js @@ -1204,7 +1204,9 @@ function renameMakeImageButton() { } } numOutputsTotalField.addEventListener('change', renameMakeImageButton) +numOutputsTotalField.addEventListener('keyup', debounce(renameMakeImageButton, 300)) numOutputsParallelField.addEventListener('change', renameMakeImageButton) +numOutputsParallelField.addEventListener('keyup', debounce(renameMakeImageButton, 300)) function onDimensionChange() { let widthValue = parseInt(widthField.value)