mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 06:24:08 +00:00
If more than one title in suggestions match, select the first item.
Addresses (Bug 42665) Change-Id: I8c425b79e34e931beb78538146a035c25023ce8a
This commit is contained in:
parent
381472ac99
commit
0ceee83950
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue