Page MenuHomePhabricator

Add CSS class to enable Search Suggestions for type=Search
Closed, ResolvedPublic


The "mw-searchInput" CSS class, when placed on an input element, will enable Search Suggest features for that element. See Code Search for reference and examples.

I've tested this locally and it works like a charm.


Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 14 2020, 2:45 PM

I uploaded a patch here

Change 620370 had a related patch set uploaded (by MarkAHershberger; owner: Freephile):
[mediawiki/extensions/InputBox@master] Adding CSS class to hook into SearchSuggest feature.

I uploaded a revised patch at

(It didn't get automatically attached by gerritbot.)

Change 620780 had a related patch set uploaded (by Aklapper; owner: Freephile):
[mediawiki/extensions/InputBox@master] Adding CSS class to hook into SearchSuggest feature.

Change 620370 abandoned by Freephile:
[mediawiki/extensions/InputBox@master] Adding CSS class to hook into SearchSuggest feature.

New patch uploaded

Based on test failures, it looks like I need to update the unit tests for InputBox.

The failures are caused by code style issues and can be fixed with "composer update && composer fix && git commit --amend && git review".

Thanks Mark @MarkAHershberger, but I already fixed the style issues in the latest commit. There are now assertions in the unit tests that are failing, due to the new class attribute not conforming to the declared / expected output of the parser tags for InputBox.

Ah, sorry. I clicked on the abandoned link instead of the new one.

freephile closed this task as Resolved.Aug 18 2020, 9:58 PM
freephile updated the task description. (Show Details)
stjn added a subscriber: stjn.EditedDec 3 2020, 7:49 PM

Belated comment: this makes zero sense for most of the uses of such search forms, which typically concern searching on a specific subset of pages and not everywhere on a wiki. Search suggestions just come up meaningless in most cases, especially in places like where the target of search box and search suggestions lead people to different places. This was a bad patch to merge essentially without discussion.

(If it makes sense for individual search forms, there should be an option to specify the class to input for authors instead.)