[wp-trac] [WordPress Trac] #42348: Themes search: reintroduce the debounced search

WordPress Trac noreply at wordpress.org
Thu Oct 26 17:55:29 UTC 2017


#42348: Themes search: reintroduce the debounced search
-------------------------------------+-------------------------------------
 Reporter:  afercia                  |       Owner:
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  4.9
Component:  Customize                |     Version:  trunk
 Severity:  normal                   |  Resolution:
 Keywords:  needs-testing needs-     |     Focuses:  ui, accessibility,
  patch                              |  javascript
-------------------------------------+-------------------------------------
Changes (by westonruter):

 * keywords:  has-patch needs-testing => needs-testing needs-patch


Comment:

 I switched from `debounce` to `throttle` in [41797] because hitting back
 from Customizer to themes screen needed to throttle instead of debounce to
 ensure that the search results are updated immediately instead to prevent
 a flash of unsearched themes. My intention was that it should do a search
 with the first keystroke and then will do a subsequent search when the
 user stops typing. Per Underscore.js [http://underscorejs.org/#throttle
 docs]:

 > By default, throttle will execute the function as soon as you call it
 for the first time, and, if you call it again any number of times during
 the wait period, as soon as that period is over. If you'd like to disable
 the leading-edge call, pass {leading: false}, and if you'd like to disable
 the execution on the trailing-edge, pass `{trailing: false}`

 But it isn't working as I expected.

 See conversation at
 https://wordpress.slack.com/archives/C0381N237/p1509028368000714

 As long as we can get the initial page to load with single non-debounced
 search, that would fix the issue as well.

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


More information about the wp-trac mailing list