Page MenuHomePhabricator

[Bug] Search box on mobile missing placeholder text
Closed, ResolvedPublic1 Estimated Story Points


There is currently no placeholder text in the search field in Minerva on mobile. It looks like the placeholder value in the <input> tag is currently blank:

<input class="search" type="search" name="search" autocomplete="off" placeholder="" value="">

For consistency as well as brand awareness I think it would be good to add the standard "Search Wikipedia" placeholder text back in here.

Developer notes

The placeholder shows up on tablet but not on mobile.
The problem is openSearchOverlay gets the placeholder from

$this.attr( 'placeholder' );

but $this in the context of mobile refers to the search button which has no placeholder. It should always be sourced from the input element. There is also no reason to get inside the event handler. It never changes.

	function openSearchOverlay( ev ) {
		var overlay,
			$this = $( this ),
			searchTerm = $this.val(),
			placeholder = $this.attr( 'placeholder' );

$( '#searchInput, #searchIcon, .skin-minerva-search-trigger' ).on( 'click', openSearchOverlay )

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 28 2018, 2:00 PM

Is this a regression or has it never been there?

Jdlrobson added a subscriber: Jdlrobson.

We use to have one. It's possible when we rebranded we lost it. I'll do some debugging today to work out when exactly we broke it but it should be an easy fix.

Jdlrobson triaged this task as Medium priority.Mar 28 2018, 4:17 PM
Jdlrobson updated the task description. (Show Details)
Jdlrobson moved this task from Incoming to Upcoming on the Readers-Web-Backlog board.
Jdlrobson updated the task description. (Show Details)Mar 28 2018, 4:23 PM
Jdlrobson updated the task description. (Show Details)Mar 28 2018, 4:26 PM
ovasileva set the point value for this task to 1.Mar 28 2018, 4:26 PM

Change 422445 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/skins/MinervaNeue@master] Restore search placeholder text

pmiazga added a subscriber: pmiazga.

Looks like this is done, moving to needs QA

Change 422445 merged by jenkins-bot:
[mediawiki/skins/MinervaNeue@master] Restore search placeholder text

ovasileva closed this task as Resolved.Mar 29 2018, 3:22 PM

Looks good