I just found out that's it not new behavior in Django 1.9. The javascript 
autofocus that existed previously has the same effect. This doesn't change 
my request though, I'd still like the autofocus to be either removed or 
optional.

Op vrijdag 6 januari 2017 18:54:54 UTC+1 schreef Adam Johnson:
>
> I think we should remove it and maybe add the Javascript back, this is 
> going to affect many peoples' workflows, some of whom are in my 
> organization.
>
> On Friday, January 6, 2017 at 5:48:12 PM UTC, Tim Graham wrote:
>>
>> As part of removing inline JavaScript in the admin [0], snippets such as 
>> document.getElementById("id_old_password").focus() were replaced with 
>> the HTML5 autofocus attribute.
>>
>> This attribute has a possibly undesired behavior [1]: "*Warning*: this 
>> attribute will force a page scroll to the field with the autofocus attribute 
>> set, even within an iframe. So: know your audience, know the position of 
>> the form."
>>
>> This attribute could be problematic on the change list's admin's search 
>> box: "When coming back to the list screen from the edit screen, the 
>> browser normally remembers your scroll position and restores it. This is 
>> desirable behavior if you want to work through a long lists of objects. 
>> However, when you include a search field in the list screen, it has 
>> autofocus enabled, which prevents the scroll position from being restored. 
>> This is annoying and unhelpful." [2]
>>
>> Do you think we should remove autofocus from the search box to remedy 
>> this complaint (and possibly go back to using JavaScript for that) or are 
>> there any better solutions here?
>>
>> [0] 
>> https://github.com/django/django/commit/d638cdc42acec608c1967f44af6be32a477c239f
>> [1] http://www.wufoo.com/html5/attributes/02-autofocus.html
>> [2] https://code.djangoproject.com/ticket/27692
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/d02bfbaa-be99-46da-9a11-a8fad7fac7cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to