Page MenuHomePhabricator

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

Description

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="">

missing-placeholder-text.jpg (928×1 px, 569 KB)

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

Is this a regression or has it never been there?

Jdlrobson subscribed.

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 Web-Team-Backlog board.

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

https://gerrit.wikimedia.org/r/422445

pmiazga subscribed.

Looks like this is done, moving to needs QA

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

https://gerrit.wikimedia.org/r/422445