Skip to content

Commit 49bc60d

Browse files
committed
Fix the connection between labels and associated input for report form
1 parent 36ffdd2 commit 49bc60d

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

frontend/src/components/Report/CoordinatesRow.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ const InputRow: React.FC<Props> = props => {
1818
{props.coordinates.map(({ label, ...field }, index) => (
1919
<div key={index}>
2020
{label !== undefined && (
21-
<label className="block font-bold mb-1" htmlFor={inputId}>
21+
<label className="block font-bold mb-1" htmlFor={`${inputId}-${index}`}>
2222
{label}
2323
</label>
2424
)}
25-
<input className="input" id={inputId} {...field} readOnly />
25+
<input className="input" id={`${inputId}-${index}`} {...field} readOnly />
2626
</div>
2727
))}
2828
</div>

frontend/src/components/SelectRow/SelectRow.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const SelectRow: React.FC<Props> = props => {
2020
return (
2121
<div className="w-full mb-5">
2222
{label !== undefined && (
23-
<label className="block font-bold mb-1" htmlFor={inputId}>
23+
<label className="block font-bold mb-1" htmlFor={field.inputId ?? inputId}>
2424
{label}
2525
{field.required === true && (
2626
<>
@@ -33,6 +33,7 @@ const SelectRow: React.FC<Props> = props => {
3333
</label>
3434
)}
3535
<SelectableDropdown
36+
inputId={field.inputId ?? inputId}
3637
{...field}
3738
{...(hasError && {
3839
['aria-invalid']: true,

frontend/src/components/pages/search/components/FilterBar/SelectableDropdown.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { useIntl } from 'react-intl';
44
import { theme } from '../../../../../../tailwind.config';
55

66
export interface SelectableDropdownProps {
7+
inputId?: string;
78
name: string;
89
options: Option[];
910
placeholder: string;

0 commit comments

Comments
 (0)