SearchBox.focusOnKeyboardInput property

Applies to Windows only

Gets or sets a value that specifies whether the search box automatically receives focus when the user types into the app window. When focus is automatically redirected to the search box, it triggers the onreceivingfocusonkeyboardinput event.

Syntax


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


var focusOnKeyboardInput = searchBox.focusOnKeyboardInput;
searchBox.focusOnKeyboardInput = focusOnKeyboardInput;

Property value

Type: Boolean

true if the search box automatically receives focus when the user types into the app window; otherwise, false. The default value is false.

Remarks

While this property is true, input on the current thread will be intercepted and redirected to the search box. Only textual input triggers the search box to focus. The caller will continue to receive non-text keys, such as arrows, tab, and so on. This setting does not affect Win, Ctrl, Alt key combinations (except for Ctrl-V for paste). If you to so something more than just redirect focus to the search box handle the onreceivingfocusonkeyboardinput event. If you enable this property, be sure to disable it if the user moves focus to another editable field in the app.

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
onreceivingfocusonkeyboardinput

 

 

Show:
© 2014 Microsoft