diff --git a/static/script.js b/static/script.js index ac23276..8419df8 100644 --- a/static/script.js +++ b/static/script.js @@ -347,6 +347,14 @@ if (elements.predictionResult) { elements.predictionResult.className = `prediction-result show ${type}`; + // Manage ARIA busy state for screen readers during updates + if (type === 'loading') { + elements.predictionResult.setAttribute('aria-busy', 'true'); + } else { + elements.predictionResult.setAttribute('aria-busy', 'false'); + // Move focus to result container so the live region is announced + elements.predictionResult.focus(); + } } // Handle loading state diff --git a/templates/index.html b/templates/index.html index 46c2200..8afa653 100644 --- a/templates/index.html +++ b/templates/index.html @@ -220,9 +220,9 @@
Try these examples:
Try these examples: