From e39cbe9f7f3069937a681b6aec2d1a66a46feec7 Mon Sep 17 00:00:00 2001 From: chris <kokosias@yahoo.gr> Date: Sat, 4 Mar 2023 21:02:24 +0200 Subject: [PATCH] add aria labels --- .../components/MatchingContainerComponent.js | 8 +++++++- .../components/MatchingOptionComponent.js | 12 ++++++++++-- .../components/AnswerComponent.js | 2 ++ .../components/AnswerComponent.js | 2 ++ .../components/AnswerComponent.js | 2 ++ .../components/AnswerComponent.js | 2 ++ 6 files changed, 25 insertions(+), 3 deletions(-) diff --git a/wax-prosemirror-services/src/MatchingService/components/MatchingContainerComponent.js b/wax-prosemirror-services/src/MatchingService/components/MatchingContainerComponent.js index 4d5afc9cd..af712f089 100644 --- a/wax-prosemirror-services/src/MatchingService/components/MatchingContainerComponent.js +++ b/wax-prosemirror-services/src/MatchingService/components/MatchingContainerComponent.js @@ -264,6 +264,7 @@ export default ({ node, view, getPos }) => { {option.label} {!readOnly && ( <ActionButton + aria-label={`delete ${option.label}`} onClick={() => removeOption(option.value)} ref={setRef(option.value)} type="button" @@ -289,7 +290,12 @@ export default ({ node, view, getPos }) => { type="text" value={optionText} /> - <button onClick={addOption} ref={addOptionBtnRef} type="button"> + <button + aria-label="add new option" + onClick={addOption} + ref={addOptionBtnRef} + type="button" + > Add Option </button> </AddOption> diff --git a/wax-prosemirror-services/src/MatchingService/components/MatchingOptionComponent.js b/wax-prosemirror-services/src/MatchingService/components/MatchingOptionComponent.js index ea42dc3a5..ae3f045aa 100644 --- a/wax-prosemirror-services/src/MatchingService/components/MatchingOptionComponent.js +++ b/wax-prosemirror-services/src/MatchingService/components/MatchingOptionComponent.js @@ -120,11 +120,19 @@ export default ({ node, view, getPos }) => { <Option> {!readOnly && ( <ButtonsContainer> - <ActionButton onClick={addAnswer} type="button"> + <ActionButton + aria-label="add new option" + onClick={addAnswer} + type="button" + > <StyledIconAction name="plusSquare" /> </ActionButton> {!node.attrs.isfirst && ( - <ActionButton onClick={removeAnswer} type="button"> + <ActionButton + aria-label="delete this option" + onClick={removeAnswer} + type="button" + > <StyledIconAction name="deleteOutlined" /> </ActionButton> )} diff --git a/wax-prosemirror-services/src/MultipleChoiceQuestionService/MultipleChoiceSingleCorrectQuestionService/components/AnswerComponent.js b/wax-prosemirror-services/src/MultipleChoiceQuestionService/MultipleChoiceSingleCorrectQuestionService/components/AnswerComponent.js index 1210e87c4..f72dee081 100644 --- a/wax-prosemirror-services/src/MultipleChoiceQuestionService/MultipleChoiceSingleCorrectQuestionService/components/AnswerComponent.js +++ b/wax-prosemirror-services/src/MultipleChoiceQuestionService/MultipleChoiceSingleCorrectQuestionService/components/AnswerComponent.js @@ -230,6 +230,7 @@ export default ({ node, view, getPos }) => { <IconsWrapper> {!readOnly && ( <ActionButton + aria-label="add new option" onClick={() => addOption(node.attrs.id)} ref={addOptionBtnRef} type="button" @@ -239,6 +240,7 @@ export default ({ node, view, getPos }) => { )} {!readOnly && ( <ActionButton + aria-label="delete this option" onClick={removeOption} ref={removeOptionBtnRef} type="button" diff --git a/wax-prosemirror-services/src/MultipleChoiceQuestionService/TrueFalseQuestionService/components/AnswerComponent.js b/wax-prosemirror-services/src/MultipleChoiceQuestionService/TrueFalseQuestionService/components/AnswerComponent.js index c96a6251f..ced1bc08f 100644 --- a/wax-prosemirror-services/src/MultipleChoiceQuestionService/TrueFalseQuestionService/components/AnswerComponent.js +++ b/wax-prosemirror-services/src/MultipleChoiceQuestionService/TrueFalseQuestionService/components/AnswerComponent.js @@ -230,6 +230,7 @@ export default ({ node, view, getPos }) => { <IconsWrapper> {!readOnly && ( <ActionButton + aria-label="add new option" onClick={() => addOption(node.attrs.id)} ref={addOptionBtnRef} type="button" @@ -239,6 +240,7 @@ export default ({ node, view, getPos }) => { )} {!readOnly && ( <ActionButton + aria-label="delete this option" onClick={removeOption} ref={removeOptionBtnRef} type="button" diff --git a/wax-prosemirror-services/src/MultipleChoiceQuestionService/TrueFalseSingleCorrectQuestionService/components/AnswerComponent.js b/wax-prosemirror-services/src/MultipleChoiceQuestionService/TrueFalseSingleCorrectQuestionService/components/AnswerComponent.js index 707d0eaf5..175601897 100644 --- a/wax-prosemirror-services/src/MultipleChoiceQuestionService/TrueFalseSingleCorrectQuestionService/components/AnswerComponent.js +++ b/wax-prosemirror-services/src/MultipleChoiceQuestionService/TrueFalseSingleCorrectQuestionService/components/AnswerComponent.js @@ -230,6 +230,7 @@ export default ({ node, view, getPos }) => { <IconsWrapper> {!readOnly && ( <ActionButton + aria-label="add new option" onClick={() => addOption(node.attrs.id)} ref={addOptionBtnRef} type="button" @@ -239,6 +240,7 @@ export default ({ node, view, getPos }) => { )} {!readOnly && ( <ActionButton + aria-label="delete this option" onClick={removeOption} ref={removeOptionBtnRef} type="button" diff --git a/wax-prosemirror-services/src/MultipleChoiceQuestionService/components/AnswerComponent.js b/wax-prosemirror-services/src/MultipleChoiceQuestionService/components/AnswerComponent.js index bd696b59e..952db5304 100644 --- a/wax-prosemirror-services/src/MultipleChoiceQuestionService/components/AnswerComponent.js +++ b/wax-prosemirror-services/src/MultipleChoiceQuestionService/components/AnswerComponent.js @@ -228,6 +228,7 @@ export default ({ node, view, getPos }) => { <IconsWrapper> {!readOnly && ( <ActionButton + aria-label="add new option" onClick={() => addOption(node.attrs.id)} ref={addOptionBtnRef} type="button" @@ -237,6 +238,7 @@ export default ({ node, view, getPos }) => { )} {!readOnly && ( <ActionButton + aria-label="delete this option" onClick={removeOption} ref={removeOptionBtnRef} type="button" -- GitLab