Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#30275 closed Uncategorized (worksforme)

Autofocus the first field in contrib.admin add form

Reported by: Nikita Ivanov Owned by: nobody
Component: contrib.admin Version: 2.1
Severity: Normal Keywords: focus, autofocus
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The contrib.admin pages to add new instance of a model used to be autofocused in 1.9 (so just after visiting /model/add admin URL you could type in value for the first model field from keyboard). That changed in 1.10 (you need to click the first widget with mouse or press [Tab] a few times). I guess, [d638cdc42acec608c1] was the relevant commit. Still no autofocus in 2.1.

I believe, the old behavior (first item focused) is by design, see #15987, so it is a regression.

Change History (2)

comment:1 by Tim Graham, 6 years ago

I can't reproduce this with the models from the tutorial (the first field is autofocused on those add pages). Do you see the problem there or else can you give details to reproduce?

comment:2 by Carlton Gibson, 6 years ago

Resolution: worksforme
Status: newclosed

No me neither... the code from 2010/2011 (74ffca17e2ca6a9f061913797efeebbc578692c5) is still there more or less unchanged — it just moved file.

The behaviour I'm seeing is correct. With both e.g. an empty field auth.Group admin and a model where the first field has a default.

I'll close on that basis, but happy to re-open if we can pin something more specific down.

Last edited 6 years ago by Carlton Gibson (previous) (diff)
Note: See TracTickets for help on using tickets.
Back to Top