Code

Opened 3 years ago

Closed 8 months 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

Description

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 3 years ago.
17074.diff (815 bytes) - added by julien 2 years ago.

Download all attachments as: .zip

Change History (6)

Changed 3 years ago by Kidwind

comment:1 Changed 3 years ago by julien

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

Changed 2 years ago by julien

comment:2 Changed 2 years ago by julien

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 17 months ago by claudep

Julien, +1 for your approach. Go ahead!

comment:4 Changed 8 months ago by claudep

  • Resolution set to fixed
  • Status changed from new to closed

In [1c0c879be3a21affec3d5eb2d6b6e4f0a0803aec]:

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

Thanks Kidwind for the report and Julien Phalip for the initial
patch.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.