#36336: Incorrect size of first autocomple in Inlines with "collapse" class (on
chromium based browsers?)
-------------------------------------+-------------------------------------
Reporter: Michał Pokusa | Owner: (none)
Type: Bug | Status: new
Component: contrib.admin | Version: 5.1
Severity: Normal | Resolution:
Keywords: autocomplete | Triage Stage: Accepted
collapse size inline |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Comment (by Michał Pokusa):
I think I need to clarify what I meant.
Yes, the jQuery docs state that the `Element.outerWidth()` will do the
show/hide thing on its own, but** it is not the solution I am talking
about here.** Therefore the limitations they mention also would not apply.
My proposed solution is to **render the details tag open from the start**,
then the autocomplete widget would initialize, and because the element
that the `outerWidth()` will operate on will be visible at this moment,
the width will be calculated correctly. Only after that, if the `"open"`
class is not present, JS would "manually" close details tags.
So, the problem will be solved, and it will not depend on the jQuery
itself, but on the order of operations. The main reason for going this way
is in my opinion, that until the Django 5.1 this is exactly how
collapsible fieldsets/inlines worked, although it was the div that was
being closed and not the details tag, but the principle stays the same.
--
Ticket URL: <
https://code.djangoproject.com/ticket/36336#comment:9>