Opened 7 years ago

Closed 5 years ago

#17074 closed Bug (fixed)

Custom widget use hidden input Bug.

Reported by: Kidwind Owned by: nobody
Component: contrib.admin Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


my custom widget use a hidden input, and use javascript to change the input's value. when my model field use the widget and in first of the form,i get "Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus." for add model object in ie6 and ie7.

Attachments (2)

change_form.html.diff (655 bytes) - added by Kidwind 7 years ago.
17074.diff (815 bytes) - added by Julien Phalip 6 years ago.

Download all attachments as: .zip

Change History (6)

Changed 7 years ago by Kidwind

Attachment: change_form.html.diff added

comment:1 Changed 7 years ago by Julien Phalip

Triage Stage: UnreviewedAccepted

Changed 6 years ago by Julien Phalip

Attachment: 17074.diff added

comment:2 Changed 6 years ago by Julien Phalip

The patch above takes a different approach to focus on the first visible field (which may be the form's second field if the first one is hidden). If we go with that approach then AdminForm.first_field would not be needed any more and could be removed.

comment:3 Changed 5 years ago by Claude Paroz

Julien, +1 for your approach. Go ahead!

comment:4 Changed 5 years ago by Claude Paroz

Resolution: fixed
Status: newclosed

In [1c0c879be3a21affec3d5eb2d6b6e4f0a0803aec]:

Fixed #17074 -- Improved first field detection in admin add form

Thanks Kidwind for the report and Julien Phalip for the initial

Note: See TracTickets for help on using tickets.
Back to Top