#34025: Bug on autocomplete field when two fields from same reference model are
added in same page
-------------------------------------+-------------------------------------
Reporter: Alexandre da Silva | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 4.1
Severity: Normal | Resolution:
Keywords: admin, autocomplete | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by David Sanders):
* component: Uncategorized => contrib.admin
Comment:
A couple of points here:
- While I could reproduce the described issue for creates, I couldn't do
so for edits. In the edit screen only the field for which I clicked "+"
was updated.
- This appears to be because both fields are required. If you make the fks
`null=True, blank=True` then this behaviour isn't shown. I'm not sure this
is something that's fixable as this is the behaviour shown for native
selects. If you create a page with simply:
{{{
<select></select>
}}}
And then run:
{{{
document.querySelector('select').options.add(new Option('test'))
}}}
it populates the select with the newly created option - because it's the
only option to select.
--
Ticket URL: <https://code.djangoproject.com/ticket/34025#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/010701835e136264-7665bbe0-f485-46b1-a29c-ec1b7543881b-000000%40eu-central-1.amazonses.com.