Skip to content

Add autofocus support for input.html templates#4650

Merged
lovelydinosaur merged 1 commit intoencode:masterfrom
jamesbeith:autofocus-input-style
Nov 7, 2016
Merged

Add autofocus support for input.html templates#4650
lovelydinosaur merged 1 commit intoencode:masterfrom
jamesbeith:autofocus-input-style

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.
@lovelydinosaur lovelydinosaur added this to the 3.5.3 Release milestone Nov 7, 2016
@lovelydinosaur lovelydinosaur merged commit befacfb into encode:master Nov 7, 2016
@lovelydinosaur
Copy link
Contributor

👍

@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

@lovelydinosaur
Copy link
Contributor

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