[wp-trac] [WordPress Trac] #30223: Customizer range controls don't update until the mouse is released

WordPress Trac noreply at wordpress.org
Sat Nov 1 00:19:16 UTC 2014


#30223: Customizer range controls don't update until the mouse is released
--------------------------+-------------------------
 Reporter:  sublink       |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  4.1
Component:  Customize     |     Version:  4.0
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:  javascript
--------------------------+-------------------------
Changes (by westonruter):

 * keywords:   => needs-patch
 * milestone:  Awaiting Review => 4.1


Comment:

 sublink: Thanks for the report! Yes, this is a good catch. For the widget
 controls added in 3.9, changes to the widget forms are being listened to
 via the `change` event but also the `input` (for non-IE) and
 `propertychange` events (for IE).

 {{{
 $widgetContent.on( 'change input propertychange', ':input', function( e )
 {
 }}}

 So the following change could be made to address the problem:

 {{{#!diff
 --- src/wp-includes/js/customize-base.js
 +++ src/wp-includes/js/customize-base.js
 @@ -430,6 +430,8 @@ window.wp = window.wp || {};
                                                 synchronizer =
 api.Element.synchronizer[ type ];
                                         if ( 'text' === type || 'password'
 === type )
                                                 this.events += ' keyup';
 +                                       else if ( 'range' === type )
 +                                               this.events += ' input
 propertychange';
                                 } else if ( this.element.is('textarea') )
 {
                                         this.events += ' keyup';
                                 }
 }}}

 (Cleanup of JS coding standards notwithstanding.)

--
Ticket URL: <https://core.trac.wordpress.org/ticket/30223#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list