fix: guard aria-describedby from rendering undefined string
This commit is contained in:
parent
8873920b83
commit
e16ea95dcc
2 changed files with 7 additions and 1 deletions
|
|
@ -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()
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -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')"
|
||||
|
|
|
|||
Loading…
Reference in a new issue