-
Notifications
You must be signed in to change notification settings - Fork 467
Labels for input fields are rendered inconsistently #7701
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Using edd_sanitize_key was breaking HTML elements which included [] characters. #7701
Can I add a tweak to a class method in this issue, too? Can the |
@LisaCee I went ahead and changed that to a |
I think the main concern is if those IDs are used in JavaScript anywhere. |
Bug Report
Expected behavior
When I add a label to an input, it should be properly associated with the input (eg: clicking on the label should move focus to the input).
Actual behavior
edd_sanitize_key
in thetext
method strips out the[]
and the label is disconnected from the field.textarea
method uses$args['name']
for the label;text
uses$args['id']
checkbox
, but it more properly usesesc_attr
so that it works in repeatershtml->
methods define anid
, but quite a few do not, and just usename
id
is not defined for a text field, for example, the text field will end up with noid
Steps to reproduce the behavior
For the Option Name field:
span
id isedd-edd_variable_prices1name-wrap
because of the use ofedd_sanitize_key
label
and anid
, or else thefor
will be blank and the label will not be associated with the fieldPrice and Default have similar issues.
Information (if a specific version is affected):
PHP Version: 7.3.5
EDD Version (or branch): master, 3.0
WordPress Version: 5.4
Any other relevant information:
As I'm working with the SL licensing addon, I'm seeing inconsistencies with how labels are added to fields--visually, most fields have some kind of visual label, but in repeatable rows especially, they're not present, which makes the inputs less accessible. This looks to be something that needs to be worked on both in Core and in extensions which use the
EDD->html
functions.The text was updated successfully, but these errors were encountered: