Skip to content

Commit

Permalink
fix: add missing attrs to fix a11y wave errors (#513)
Browse files Browse the repository at this point in the history
  • Loading branch information
sonya0504 authored Jul 22, 2024
1 parent c2a374a commit f93dcad
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/components/organisms/UiModal/UiModal.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ export default {
backdropAttrs: { 'data-testid': 'backdrop' },
transitionDialogAttrs: { 'data-testid': 'dialog-transition' },
dialogAttrs: { 'data-testid': 'dialog-element' },
headingTitleAttrs: { 'data-testid': 'title-heading' },
headingTitleAttrs: {
'data-testid': 'title-heading',
id: 'title-heading',
},
textContentAttrs: { 'data-testid': 'content-text' },
buttonConfirmAttrs: { 'data-testid': 'confirm-button' },
buttonCancelAttrs: { 'data-testid': 'cancel-button' },
Expand Down Expand Up @@ -815,6 +818,7 @@ export const WithInputInContentSlot = {
const button = ref(null);
const input = ref(null);
const errorMessage = ref(false);
const inputAttrs = { 'aria-labelledby': 'title-heading' };

function onConfirm() {
if (searchText.value) {
Expand Down Expand Up @@ -861,6 +865,7 @@ export const WithInputInContentSlot = {
onCancel,
input,
button,
inputAttrs,
};
},
template: `<UiModal
Expand Down Expand Up @@ -900,6 +905,7 @@ export const WithInputInContentSlot = {
'ui-form-field__input',
{ 'ui-input--has-error': errorMessage },
]"
:input-attrs="inputAttrs"
/>
</UiFormField>
</template>
Expand Down Expand Up @@ -935,6 +941,7 @@ export const WithWithTextareaAsContentSlotOnMobile = {
const button = ref(null);
const textarera = ref(null);
const errorMessage = ref(false);
const textareaAttrs = { 'aria-labelledby': 'title-heading' };

function onConfirm() {
if (searchText.value) {
Expand Down Expand Up @@ -981,6 +988,7 @@ export const WithWithTextareaAsContentSlotOnMobile = {
onCancel,
textarera,
button,
textareaAttrs,
};
},
template: `<UiModal
Expand Down Expand Up @@ -1021,6 +1029,7 @@ export const WithWithTextareaAsContentSlotOnMobile = {
'ui-form-field__textarea',
{ 'ui-textarea--has-error': errorMessage },
]"
:textarea-attrs="textareaAttrs"
/>
</UiFormField>
</template>
Expand Down

0 comments on commit f93dcad

Please sign in to comment.