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
This is neither the bug nor the feature request. The closest I could classify this is the improvement request.
In short, when using Outlined checks all the examples show that the input element has an id attribute, which label element references in its for attribute. This seems like a waste of time since we need to provide unique values for all those ids on the page, which can quickly get troublesome when adding elements in a loop, for example, when displaying search results or so. We usually need to come up with some unique patterns for those ids making sure those won't repeat on the same page.
A simple html alternative is not to use id/for pair, but to simply put the input element inside the label element. Given that the input element is hidden anyway, it won't affect the content displayed within the label element.
In short, is it too much of a work to change the id/for pair approach with nested input inside the label element?
Prerequisites
Describe the issue
Hi,
This is neither the bug nor the feature request. The closest I could classify this is the improvement request.
In short, when using Outlined checks all the examples show that the
input
element has anid
attribute, whichlabel
element references in itsfor
attribute. This seems like a waste of time since we need to provide unique values for all thoseid
s on the page, which can quickly get troublesome when adding elements in a loop, for example, when displaying search results or so. We usually need to come up with some unique patterns for thoseid
s making sure those won't repeat on the same page.A simple html alternative is not to use
id/for
pair, but to simply put theinput
element inside thelabel
element. Given that theinput
element is hidden anyway, it won't affect the content displayed within thelabel
element.In short, is it too much of a work to change the
id/for
pair approach with nestedinput
inside thelabel
element?More info on implicit labels: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label#defining_an_implicit_label
Example:
<label>Click me <input type="text" /></label>
Thanks.
Reduced test cases
could become
What operating system(s) are you seeing the problem on?
Windows, Linux
What browser(s) are you seeing the problem on?
Chrome, Firefox, Microsoft Edge
What version of Bootstrap are you using?
5.3
The text was updated successfully, but these errors were encountered: