#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>
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 visit 
https://groups.google.com/d/msgid/django-updates/010701967959bf5a-177636ed-45e0-4e64-ad1c-5bcae931fb46-000000%40eu-central-1.amazonses.com.

Reply via email to