[wp-trac] [WordPress Trac] #26600: Search installed themes input has no submit button
WordPress Trac
noreply at wordpress.org
Tue Mar 31 16:18:38 UTC 2015
#26600: Search installed themes input has no submit button
----------------------------------+----------------------------------------
Reporter: grahamarmfield | Owner: SergeyBiryukov
Type: defect (bug) | Status: reviewing
Priority: normal | Milestone: 4.2
Component: Themes | Version: 3.8
Severity: normal | Resolution:
Keywords: has-patch dev- | Focuses: accessibility, javascript
feedback |
----------------------------------+----------------------------------------
Comment (by adamsilverstein):
* As far as i can tell, 'search': 'search', is never triggered and
can/should be removed
* doSearch is part of the InstallerSearch view and only used there
* my _.debounce wraps search in themes.view.Search, so that no matter how
many times search is triggered by Backbone.events, the function is only
executed once, 250ms after no more events arrive. _.debounce returns a new
function, so you can think of the debounced function as a doSearch for the
View. I did it this way to keep the code more concise, however it might
make sense to break it out a bit more to make the functionality clearer. I
can update the patch with a doSearch function here as well.
Replying to [comment:52 afercia]:
> Replying to [comment:51 adamsilverstein]:
> > I think you need more than keyup to cover some edge cases: pasting
text into search would be a change event. I'll dig into what search is,
not sure;
> Makes sense, but then we should do the same for
`themes.view.InstallerSearch` where there's only this:
> {{{
> events: {
> 'keyup': 'search'
> },
>
> }}}
>
> > by debouncing the search event, we prevent the events from multi-
firing, so when keyup and change are triggered one after another only one
search gets executed, and wp.speak should only run once.
> Not sure about this :) the keyup event needs to multi-fire, actually
it's how we can detect users are still typing and `doSearch` needs to be
continuously called and should be debounced. See #31812. Working on a
patch, seems to work as intended but for sure we need to increase the
"wait" interval to at least 500 ms, same value already used in wpLink:
https://core.trac.wordpress.org/browser/trunk/src/wp-
includes/js/wplink.js?rev=31606#L67 or probably even more than 500 (at
least for the installer search).
--
Ticket URL: <https://core.trac.wordpress.org/ticket/26600#comment:53>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list