Skip to content

Commit 1fef2ca

Browse files
Fatimahzzacharo
authored andcommitted
Accessibility changes in the deposit form
1 parent 9cbee52 commit 1fef2ca

File tree

5 files changed

+13
-5
lines changed

5 files changed

+13
-5
lines changed

src/lib/forms/ArrayField.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,13 @@ export class ArrayField extends Component {
110110
);
111111
})}
112112

113-
<label className="helptext">{helpText}</label>
113+
{helpText && <label className="helptext">{helpText}</label>}
114114

115115
<Form.Group>
116116
<Form.Button
117117
type="button"
118118
icon
119-
className="align-self-end"
119+
className="align-self-end mt-15"
120120
labelPosition="left"
121121
onClick={() => {
122122
arrayHelpers.push({
@@ -140,6 +140,7 @@ export class ArrayField extends Component {
140140
<FieldArray
141141
className="invenio-array-field"
142142
name={fieldPath}
143+
id={fieldPath}
143144
component={this.renderFormField}
144145
/>
145146
);

src/lib/forms/RemoteSelectField.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@ export class RemoteSelectField extends Component {
212212
options={suggestions}
213213
noResultsMessage={this.getNoResultsMessage()}
214214
search={compProps.search}
215+
searchInput={{
216+
id: compProps.fieldPath,
217+
}}
215218
lazyLoad
216219
open={open}
217220
onClose={this.onClose}

src/lib/forms/SelectField.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ export class SelectField extends Component {
6767
// otherwise it would be displayed despite updating the fieldu
6868
(initialValue === value && getIn(initialErrors, fieldPath, null))
6969
}
70-
id={fieldPath}
71-
label={{ children: label, htmlFor: fieldPath }}
70+
label={{ children: label}}
7271
name={fieldPath}
7372
onBlur={handleBlur}
7473
onChange={(event, data) => {

src/lib/forms/TextField.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export class TextField extends Component {
4545
disabled={disabled}
4646
fluid
4747
label={label}
48+
id={fieldPath}
4849
required={required}
4950
{...uiProps}
5051
/>

src/lib/forms/widgets/select/Dropdown.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,12 @@ export default class Dropdown extends Component {
3232
label={<FieldLabel htmlFor={fieldPath} icon={icon} label={label} />}
3333
options={this.serializeOptions(options)}
3434
search={search}
35+
aria-label={label}
3536
multiple={multiple}
36-
placeholder={placeholder}
37+
placeholder={{
38+
role: "option",
39+
content: placeholder,
40+
}}
3741
clearable={clearable}
3842
required={required}
3943
optimized

0 commit comments

Comments
 (0)