[wp-trac] [WordPress Trac] #42343: Customize: Themes search debounce is not debounced properly
WordPress Trac
noreply at wordpress.org
Thu Oct 26 15:53:58 UTC 2017
#42343: Customize: Themes search debounce is not debounced properly
--------------------------+------------------------------
Reporter: afercia | Owner: adamsilverstein
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 4.9
Component: Customize | Version: trunk
Severity: normal | Resolution:
Keywords: needs-patch | Focuses: ui, javascript
--------------------------+------------------------------
Comment (by westonruter):
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
--
Ticket URL: <https://core.trac.wordpress.org/ticket/42343#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list