If more than one title in suggestions match, select the first item.

Addresses (Bug 42665)

Change-Id: I8c425b79e34e931beb78538146a035c25023ce8a
This commit is contained in:
Rob Moen 2012-12-04 10:49:15 -08:00 committed by Trevor Parscal
parent 381472ac99
commit 0ceee83950

View file

@ -229,8 +229,11 @@
.css( 'whiteSpace', 'nowrap' ) .css( 'whiteSpace', 'nowrap' )
.text( group.items[i] ) .text( group.items[i] )
); );
// Select this item by default // Select the first item by default
if ( group.items[i].toLowerCase() === $input.val().toLowerCase() ) { if (
$multiSuggest.find( '.selected' ).length === 0 &&
group.items[i].toLowerCase() === $input.val().toLowerCase() )
{
$item.addClass( 'selected' ); $item.addClass( 'selected' );
} }
// CSS Ellipsis // CSS Ellipsis