[wp-trac] [WordPress Trac] #38211: Interference of AJAX search with input field auto-complete

WordPress Trac noreply at wordpress.org
Tue Jan 10 06:47:39 UTC 2017


#38211: Interference of AJAX search with input field auto-complete
-------------------------------------------------+-------------------------
 Reporter:  armandsdz                            |       Owner:
     Type:  defect (bug)                         |  adamsilverstein
 Priority:  normal                               |      Status:  assigned
Component:  Plugins                              |   Milestone:  Future
 Severity:  normal                               |  Release
 Keywords:  ux-feedback uniform-search has-      |     Version:  4.6
  patch needs-testing                            |  Resolution:
                                                 |     Focuses:  ui,
                                                 |  accessibility
-------------------------------------------------+-------------------------

Comment (by finalwebsites):

 Replying to [comment:18 adamsilverstein]:
 > [attachment:38211.3.diff] Is an alternate approach that limits searching
 until you type at least 2 characters, and dynamically removes the
 autocomplete attribute before the ajax search kicks in. We use a similar
 approach in `nav-menus.js`.
 >
 > This gives you one character to type in and see/select autocomplete
 results, once you hit 2 characters, the ajax search kicks in and
 autocomplete has been disabled for the field.  You can override the
 threshold by setting `wp.updates.searchMinCharacters` after the JS loads.
 >
 > @mklusak & @finalwebsites & @armandsdz can you test this out and see
 what you think?
 >
 > * add a new variable developers can adjust, defaults to 2:
 `wp.updates.searchMinCharacters = 2;`
 > * leave autocomplete enabled for search field until user types
 searchMinCharacters - 1 (right before ajax search kicks in)
 > * only perform ajax search when searchMinCharacters reached. also re-
 search on empty field so if suer clears field results are reset

 I tried this patch but the live search is still searching after I entered
 the first character. It takes a second now before something happens. In my
 opinion the code is missing that limits the search for the
 searchMinCharacters var.

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


More information about the wp-trac mailing list