handlePostalCodeStates(event, setIsPostalCodeOther)}
@@ -303,6 +307,7 @@ const UserForm = ({ answerStatus, setAnswerStatus }: UserFormProps) => {
required: false,
})}
role="listbox"
+ id="optional_postal_code"
onChange={(event) => handlePostalCodeStates(event, setIsOptionalPostalCode)}
disabled={isOptionalPostalCodeOther}
aria-required="false"
@@ -331,6 +336,7 @@ const UserForm = ({ answerStatus, setAnswerStatus }: UserFormProps) => {
@@ -362,11 +368,12 @@ const UserForm = ({ answerStatus, setAnswerStatus }: UserFormProps) => {
-
@@ -374,6 +381,7 @@ const UserForm = ({ answerStatus, setAnswerStatus }: UserFormProps) => {
= ({ question }) => {
mainOption.option === option.id)}
onChange={(event) => createAnswerEvent(event, option)}
- aria-disabled={
- limitSelections &&
- mainOptions.length >= 3 &&
- disabledOptions.includes(option.id)
- }
disabled={
limitSelections &&
mainOptions.length >= 3 &&
@@ -161,12 +157,14 @@ const TableCommon: React.FC = ({ question }) => {
{option.is_other ? (
setOtherValue(event.target.value)}
+ aria-describedby={`charCount_${option.id}`}
placeholder={renderLocaleValue(
getLocaleText,
option.value_fi,
@@ -174,13 +172,15 @@ const TableCommon: React.FC = ({ question }) => {
option.value_sv,
)}
/>
- {`${otherCount}/${maxCount} ${intl.formatMessage({
+ {`${otherCount}/${maxCount} ${intl.formatMessage({
id: 'app.form.helperText.characters',
})}`}
|
) : (
-
+
{renderLocaleValue(
getLocaleText,
option.value_fi,
diff --git a/src/components/Tables/TableExtended/TableExtended.tsx b/src/components/Tables/TableExtended/TableExtended.tsx
index 609954b0..dc3c9fd5 100644
--- a/src/components/Tables/TableExtended/TableExtended.tsx
+++ b/src/components/Tables/TableExtended/TableExtended.tsx
@@ -161,9 +161,7 @@ const TableExtended: React.FC = ({ questionData }) => {
{intl.formatMessage({ id: 'app.text.options' })} |
{optionsArray?.map((item) => (
-
- {renderLocaleValue(getLocaleText, item.value_fi, item.value_en, item.value_sv)}
-
+ {renderLocaleValue(getLocaleText, item.value_fi, item.value_en, item.value_sv)}
|
))}
| |
@@ -172,7 +170,7 @@ const TableExtended: React.FC
= ({ questionData }) => {
{subQuestionsArray?.map((item) => (
-
+
{renderLocaleValue(
getLocaleText,
item.description_fi,
@@ -186,6 +184,7 @@ const TableExtended: React.FC = ({ questionData }) => {
.map((option) => (
= ({ questionData }) => {
|
= ({ questionData }) => {
{option.is_other ? (
|
setOtherValue(event.target.value)}
+ aria-describedby={`charCount_${option.id}`}
placeholder={renderLocaleValue(
getLocaleText,
option.value_fi,
@@ -235,13 +237,15 @@ const TableExtended: React.FC = ({ questionData }) => {
option.value_sv,
)}
/>
- {`${otherCount}/${maxCount} ${intl.formatMessage({
+ {`${otherCount}/${maxCount} ${intl.formatMessage({
id: 'app.form.helperText.characters',
})}`}
|
) : (
-
+
{renderLocaleValue(
getLocaleText,
option.value_fi,
diff --git a/src/components/Tables/TableExtended/__tests__/TableExtended.test.tsx b/src/components/Tables/TableExtended/__tests__/TableExtended.test.tsx
index 3f0ce16e..e6d7462b 100644
--- a/src/components/Tables/TableExtended/__tests__/TableExtended.test.tsx
+++ b/src/components/Tables/TableExtended/__tests__/TableExtended.test.tsx
@@ -59,9 +59,10 @@ describe('', () => {
,
);
+ const p = container.querySelectorAll('p');
const label = container.querySelectorAll('label');
- expect(label[0].textContent).toContain(mockProps.questionData.options[0].value_fi);
- expect(label[1].textContent).toContain(mockProps.questionData.sub_questions[0].description_fi);
+ expect(p[0].textContent).toContain(mockProps.questionData.options[0].value_fi);
+ expect(label[0].textContent).toContain(mockProps.questionData.sub_questions[0].description_fi);
});
it('does contain input', () => {
| |