ionic-framework
ionic-framework copied to clipboard
feat(ionLabel): Add prop to specify 'for' value
Prerequisites
- [X] I have read the Contributing Guidelines.
- [X] I agree to follow the Code of Conduct.
- [X] I have searched for existing issues that already include this feature request, without success.
Describe the Feature Request
To be able to specify the 'for' on the ionLabel to have greater control over the field the ionLabel should target/focus.
Describe the Use Case
Enables the use of standard ionic form components and decouples the ionLabel from needing to be wrapped in an ionItem in order for the label to target the form field.
Describe Preferred Solution
No response
Describe Alternatives
Alternatively, update all form components to pass the id to the shadow DOM element so they become targetable via the standard label element.
Related Code
No response
Additional Information
I have been unable to find a suitable, scalable solution to this issue.
Thanks for the issue. We have an alternative proposal here which should accomplish the same goal: https://github.com/ionic-team/ionic-framework/discussions/25661
Can you give this a look and let me know if it works for your use case?
Thanks for the issue! This issue is being closed due to the lack of a reply. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Thank you for using Ionic!