From e16ea95dcc771126af434b3a93f9faa2b0f36efa Mon Sep 17 00:00:00 2001 From: pyr0ball Date: Wed, 8 Apr 2026 15:22:12 -0700 Subject: [PATCH] fix: guard aria-describedby from rendering undefined string --- web/src/components/SftCorrectionArea.test.ts | 6 ++++++ web/src/components/SftCorrectionArea.vue | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/web/src/components/SftCorrectionArea.test.ts b/web/src/components/SftCorrectionArea.test.ts index 5c72d6a..8ecc409 100644 --- a/web/src/components/SftCorrectionArea.test.ts +++ b/web/src/components/SftCorrectionArea.test.ts @@ -59,4 +59,10 @@ describe('SftCorrectionArea', () => { await w.find('textarea').trigger('keydown', { key: 'Enter', ctrlKey: true }) expect(w.emitted('submit')).toBeFalsy() }) + + it('omits aria-describedby when describedBy prop is not provided', () => { + const w = mount(SftCorrectionArea) + const textarea = w.find('textarea') + expect(textarea.attributes('aria-describedby')).toBeUndefined() + }) }) diff --git a/web/src/components/SftCorrectionArea.vue b/web/src/components/SftCorrectionArea.vue index b9279f5..44dfd2e 100644 --- a/web/src/components/SftCorrectionArea.vue +++ b/web/src/components/SftCorrectionArea.vue @@ -10,7 +10,7 @@ class="correction-textarea" aria-label="Write corrected response" aria-required="true" - :aria-describedby="describedBy" + :aria-describedby="describedBy || undefined" placeholder="Write the response this model should have given..." rows="4" @keydown.escape="$emit('cancel')"