#24406: SelectFilter should use click events instead of href javascript 
functions
-------------------------------------+-------------------------------------
     Reporter:  rjagerman            |                    Owner:  rjagerman
         Type:                       |                   Status:  assigned
  Cleanup/optimization               |
    Component:  contrib.admin        |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:  admin SelectFilter   |             Triage Stage:
  javascript                         |  Unreviewed
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Description changed by rjagerman:

Old description:

> SelectFilter uses javascript in an href to handle button behavior:
> {{{
> <a href="javascript:function(){...}">
> }}}
>
> This is problematic if one wishes to customize the widget, since the href
> javascript is executed after events are handled. It would be better to
> use a click event to handle this type of behavior:
> {{{
> someElement.addEventListener("click", function() { ... } );
> }}}
>
> I have proposed a patch on github:
>
> https://github.com/rjagerman/django/tree/ticket_24406
> https://github.com/rjagerman/django/commit/e07a0be20d6da81794eaa5b64c2927cc6c70410d

New description:

 SelectFilter uses javascript in an href to handle button behavior:
 {{{
 <a href="javascript:function(){...}">
 }}}

 This is problematic if one wishes to customize the widget, since the href
 javascript is executed after events are handled. It would be better to use
 a click event to handle this type of behavior:
 {{{
 someElement.addEventListener("click", function() { ... } );
 }}}

 I have proposed a patch on github:

 https://github.com/django/django/pull/4205
 https://github.com/rjagerman/django/tree/ticket_24406
 
https://github.com/rjagerman/django/commit/e07a0be20d6da81794eaa5b64c2927cc6c70410d

--

--
Ticket URL: <https://code.djangoproject.com/ticket/24406#comment:3>
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.bf8d5e30f521e3a7c89d7801484739f2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to