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

Modified html_params to treat aria attributes the same as data attributes #389

Merged
merged 2 commits into from Jun 4, 2018
Merged

Modified html_params to treat aria attributes the same as data attributes #389

merged 2 commits into from Jun 4, 2018

Conversation

ftm
Copy link
Contributor

@ftm ftm commented May 10, 2018

Fixing #239, when specifying field attributes in a template if the attribute begins with aria_, then the generated attribute shall begin with aria-, just like how data attributes are handled.

For example

{{ form.username(aria_describedby='usernameHelp') }}

will now make

<input aria-describedby="usernameHelp" id="username" name="username" value="" type="text">

I also corrected the documentation for html_params, clarifying how when using data_ or aria_ attributes every underscore gets replaced with a hyphen - not just the first one.

@davidism davidism merged commit a866eb6 into wtforms:master Jun 4, 2018
1 check passed
@ftm ftm deleted the aria-attributes branch Jun 4, 2018
azmeuk added a commit to azmeuk/wtforms that referenced this issue Apr 18, 2020
azmeuk added a commit to azmeuk/wtforms that referenced this issue Apr 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants