Skip to content
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

Option ['role' => 'form'] is not necessary for Form::create() #394

Closed
mixable opened this issue Oct 11, 2023 · 0 comments · Fixed by #395
Closed

Option ['role' => 'form'] is not necessary for Form::create() #394

mixable opened this issue Oct 11, 2023 · 0 comments · Fixed by #395

Comments

@mixable
Copy link

mixable commented Oct 11, 2023

What you did

Create a form by using FormHelper::create(). This results in a form tag <form ... role='form'> ... </form> as the method FormHelper::create() uses the default option 'role' => 'form' to create form tags (see line 409)

Expected Behavior

No 'role' attribute in form tags, as 'role' is not necessary. According to MDN web docs, [...] The HTML <form> element is sufficient to tell assistive technologies that there is a form. [...].

Actual Behavior

For forms created this way, the PageSpeed Insights raise a warning as follows:
image001

I would suggest to remove the default value of the role attribute of line 409 to get a valid html document.

ADmad added a commit that referenced this issue Oct 21, 2023
Fixes #394 - Removes role="form" from form tags.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant