Skip to content

Commit a707878

Browse files
authored
Merge pull request #1357 from rvsia/fix-ant-id
fix(ant): use htmlFor and id instead of Form.item name
2 parents fdf90d2 + d2a4ed6 commit a707878

File tree

8 files changed

+8
-1
lines changed

8 files changed

+8
-1
lines changed

packages/ant-component-mapper/src/date-picker/date-picker.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ const DatePicker = (props) => {
3030
readOnly={isReadOnly}
3131
{...input}
3232
value={input.value || null}
33+
id={input.name}
3334
{...rest}
3435
/>
3536
</FormGroup>

packages/ant-component-mapper/src/form-group/form-group.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const FormGroup = ({ label, children, isRequired, FormItemProps, meta, validateO
1616
help={help}
1717
label={!hideLabel && label}
1818
required={isRequired}
19-
name={input?.name}
19+
htmlFor={input?.name}
2020
{...FormItemProps}
2121
>
2222
{children}

packages/ant-component-mapper/src/select/select.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ const Select = (props) => {
5454
disabled={isDisabled || isReadOnly}
5555
onChange={(value, option) => input.onChange(isMulti ? selectValue(option) : option ? option.value : undefined)}
5656
input={input}
57+
id={input.name}
5758
{...rest}
5859
>
5960
{options

packages/ant-component-mapper/src/slider/slider.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ const Slider = (props) => {
4343
range={range}
4444
min={min}
4545
max={max}
46+
id={input.name}
4647
{...rest}
4748
/>
4849
</FormGroup>

packages/ant-component-mapper/src/switch/switch.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export const Switch = (props) => {
3737
input={input}
3838
>
3939
<AntSwitch
40+
id={input.name}
4041
{...rest}
4142
defaultValue={input.checked ? input.checked : undefined}
4243
onChange={onChange}

packages/ant-component-mapper/src/text-field/text-field.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const TextField = (props) => {
2626
disabled={isDisabled}
2727
readOnly={isReadOnly}
2828
placeholder={placeholder}
29+
id={input.name}
2930
{...rest}
3031
/>
3132
</FormGroup>

packages/ant-component-mapper/src/textarea/textarea.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const Textarea = (props) => {
2828
disabled={isDisabled}
2929
readOnly={isReadOnly}
3030
placeholder={placeholder}
31+
id={input.name}
3132
{...rest}
3233
/>
3334
</FormGroup>

packages/ant-component-mapper/src/time-picker/time-picker.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const TimePicker = (props) => {
3232
defaultValue={input.value ? input.value : undefined}
3333
{...input}
3434
value={input.value || null}
35+
id={input.name}
3536
{...rest}
3637
/>
3738
</FormGroup>

0 commit comments

Comments
 (0)