SearchBox.chooseSuggestionOnEnter property

Applies to Windows only

Gets or sets whether the first suggestion is chosen when the user presses Enter.

Syntax


<div 
    data-win-control="WinJS.UI.SearchBox" 
    data-win-options="{ chooseSuggestionOnEnter : value}" >
</div>


var chooseSuggestionOnEnter = searchBox.chooseSuggestionOnEnter;
searchBox.chooseSuggestionOnEnter = chooseSuggestionOnEnter;

Property value

Type: Boolean

true if the first suggestion should be automatically chosen when the user presses Enter; false if the user must explicitly move focus to the first item for Enter to select it. The default value is false.

Remarks

When this property is true, as the user types in the search box, a focus rectangle is drawn on the first search suggestion (if present and no IME composition in progress). Pressing Enter will behave the same as if the user clicked on the focused suggestion, and the down arrow key press will put real focus to the second suggestion and the up arrow key will remove focus.

Requirements

Minimum supported client

Windows 8.1 [Windows Store apps only]

Minimum supported server

Windows Server 2012 R2 [Windows Store apps only]

Minimum supported phone

None supported

Namespace

WinJS.UI

Library

Ui.js

See also

SearchBox

 

 

Show:
© 2014 Microsoft