Based on previous changes to Django, I believe that this discrepancy is
unintended. Therefore, this patch changes `SelectFilter2.js` to also
create `multiple` attributes that use the HTML5 syntax, bringing it in
line with the behavior of other parts of Django.
The syntax of the test covering this change may appear somewhat convoluted
at first, but this was done purposefully to avoid using jQuery's
`.attr()`. When `.attr()` is called to get certain types of attributes,
jQuery "normalizes" the output to hide differences between browsers. In
the case of `multiple`, it appears that jQuery always returns the value
"multiple" if the `multiple` attribute is present, regardless of whether
`multiple` was defined as a boolean or contains a string. (You can even
set `multiple` to a random string and it will still return the value
"multiple".) So, to test the actual value of the `multiple` attribute,
the jQuery object is first translated to the DOM element, then
`getAttribute('multiple')` is called on it.
As per the Django contribution documentation, I have edited the release
notes, and have tried to mimic the wording of the release notes from
ticket #29041.
Thank you for taking the time to review this issue and pull request. Any
feedback is of course greatly appreciated.
--
Ticket URL: <https://code.djangoproject.com/ticket/31404>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* has_patch: 0 => 1
* stage: Unreviewed => Accepted
Comment:
[https://github.com/django/django/pull/12631 PR] — Thanks for the patch.
Seems reasonable. Will Accept to review. 👍
--
Ticket URL: <https://code.djangoproject.com/ticket/31404#comment:1>
* stage: Accepted => Unreviewed
Comment:
[https://github.com/django/django/pull/12631 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/31404#comment:2>
* owner: nobody => zriv
* status: new => assigned
* component: Forms => contrib.admin
* stage: Unreviewed => Accepted
Comment:
[https://github.com/django/django/pull/12631 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/31404#comment:3>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/31404#comment:4>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"b9336b78cf2a9a29f4934041c9e221bc68daec80" b9336b7]:
{{{
#!CommitTicketReference repository=""
revision="b9336b78cf2a9a29f4934041c9e221bc68daec80"
Fixed #31404 -- Changed selector-chosen's multiple attribute to HTML5
boolean syntax.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/31404#comment:5>