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
I have searched the issues of this repository and believe that this is not a duplicate.
What problem does this feature solve?
I am currently in the situation, where I want to use the aria-labelledBy attribute on an , to correctly associate the with it's label.
The aria-labelledby attribute requires the label to have an id set.
In general form labels in ant design don't seem to have the id attribute set, which also causes issues when using automated testing frameworks.
In this case to make the whole thing work I'd need a possibility to set the id on the generated .
What does the proposed API look like?
I'd suggest adding a labelId attribute to the <Form.Item/>, enabling the developer to set an id to the label tag.
If no labelId is provided I'd default to something like lbl_${formName}_{formItemName}.
What problem does this feature solve?
I am currently in the situation, where I want to use the aria-labelledBy attribute on an , to correctly associate the with it's label.
The aria-labelledby attribute requires the label to have an id set.
In general form labels in ant design don't seem to have the id attribute set, which also causes issues when using automated testing frameworks.
In this case to make the whole thing work I'd need a possibility to set the id on the generated .
What does the proposed API look like?
I'd suggest adding a labelId attribute to the <Form.Item/>, enabling the developer to set an id to the label tag.
If no labelId is provided I'd default to something like
lbl_${formName}_{formItemName}
.Suggestion:
The labelId parameter is then applied to the generated label tag.
Another more generic possibility would be to add a labelProps property, which is an object of attributes, that are then applied to the label tag.
I'd prefer the second solution, as this would allow developers to set whatever attribute they want ont the .
I'm happy to discuss the issue. If this is an acceptable change let me know and I can make a PR.
The text was updated successfully, but these errors were encountered: