You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`To correctly render this field with the correct ARIA attributes passed to the input, please pass one of the component from @primer/react as a direct child of the FormControl component: ${expectedInputComponents.reduce(
62
-
(acc,componentName)=>{
63
-
acc+=`\n- ${componentName.displayName}`
64
-
65
-
returnacc
66
-
},
67
-
''
68
-
)}`,
69
-
'If you are using a custom input component, please be sure to follow WCAG guidelines to make your form control accessible.'
`instead of passing the 'id' prop directly to the input component, it should be passed to the parent component, <FormControl>`
76
-
)
77
-
}
78
-
if(inputProps?.disabled){
79
-
// eslint-disable-next-line no-console
80
-
console.warn(
81
-
`instead of passing the 'disabled' prop directly to the input component, it should be passed to the parent component, <FormControl>`
82
-
)
83
-
}
84
-
if(inputProps?.required){
85
-
// eslint-disable-next-line no-console
86
-
console.warn(
87
-
`instead of passing the 'required' prop directly to the input component, it should be passed to the parent component, <FormControl>`
88
-
)
89
-
}
90
-
}
91
-
92
-
if(!labelChild){
93
-
// eslint-disable-next-line no-console
94
-
console.error(
95
-
`The input field with the id ${id} MUST have a FormControl.Label child.\n\nIf you want to hide the label, pass the 'visuallyHidden' prop to the FormControl.Label component.`
'Validation messages are not rendered for an individual checkbox or radio. The validation message should be shown for all options.'
62
+
`To correctly render this field with the correct ARIA attributes passed to the input, please pass one of the component from @primer/react as a direct child of the FormControl component: ${expectedInputComponents.reduce(
63
+
(acc,componentName)=>{
64
+
acc+=`\n- ${componentName.displayName}`
65
+
66
+
returnacc
67
+
},
68
+
''
69
+
)}`,
70
+
'If you are using a custom input component, please be sure to follow WCAG guidelines to make your form control accessible.'
104
71
)
72
+
}else{
73
+
if(inputProps?.id){
74
+
// eslint-disable-next-line no-console
75
+
console.warn(
76
+
`instead of passing the 'id' prop directly to the input component, it should be passed to the parent component, <FormControl>`
77
+
)
78
+
}
79
+
if(inputProps?.disabled){
80
+
// eslint-disable-next-line no-console
81
+
console.warn(
82
+
`instead of passing the 'disabled' prop directly to the input component, it should be passed to the parent component, <FormControl>`
83
+
)
84
+
}
85
+
if(inputProps?.required){
86
+
// eslint-disable-next-line no-console
87
+
console.warn(
88
+
`instead of passing the 'required' prop directly to the input component, it should be passed to the parent component, <FormControl>`
'A leading visual is only rendered for a checkbox or radio form control. If you want to render a leading visual inside of your input, check if your input supports a leading visual.'
95
+
console.error(
96
+
`The input field with the id ${id} MUST have a FormControl.Label child.\n\nIf you want to hide the label, pass the 'visuallyHidden' prop to the FormControl.Label component.`
'A leading visual is only rendered for a checkbox or radio form control. If you want to render a leading visual inside of your input, check if your input supports a leading visual.'
0 commit comments