[wp-trac] [WordPress Trac] #38211: Interference of AJAX search with input field auto-complete
WordPress Trac
noreply at wordpress.org
Mon Jan 9 19:38:32 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
-------------------------------------------------+-------------------------
Changes (by adamsilverstein):
* owner: => adamsilverstein
* status: new => assigned
Comment:
[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
--
Ticket URL: <https://core.trac.wordpress.org/ticket/38211#comment:18>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list