Skip to content

Add autofocus support for input.html templates #4650

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

Merged
merged 1 commit into from
Nov 7, 2016
Merged

Add autofocus support for input.html templates #4650

merged 1 commit into from
Nov 7, 2016

Conversation

jamesbeith
Copy link
Contributor

Description

This change adds support to use 'autofocus': True in the style options and have the autofocus attribute included on the input field when rendered.

This change adds support to use `'autofocus': True` in the style options and have the `autofocus` attribute included on the input field when rendered.
@tomchristie tomchristie added this to the 3.5.3 Release milestone Nov 7, 2016
@tomchristie tomchristie merged commit befacfb into encode:master Nov 7, 2016
@tomchristie
Copy link
Member

👍

@jamesbeith
Copy link
Contributor Author

@tomchristie I'd considered adding similar support for autocomplete too but then there's also pattern, step and other input attributes that might be of some use. Had you considered using a more freeform dictionary approach for adding attributes to fields similar to Django's Widget.attrs?
https://docs.djangoproject.com/en/1.10/ref/forms/widgets/#django.forms.Widget.attrs

@tomchristie
Copy link
Member

It's not really something that's come in for consideration, no.
Happy to accept particular proposals, but it's not obvious how we'd best fit it in: Don't esp. want to nest things under style any further, but don't want to just blindly pull everything through to the template either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants