Freigeben über


SearchBox.onreceivingfocusonkeyboardinput event

[SearchBox is no longer available for use as of Windows 10. Instead, use AutoSuggestBox. ]

Raised when the app automatically redirects focus to the search box. This event can only be raised when the focusOnKeyboardInput property is set to true.

Syntax

<div 
    data-win-control="WinJS.UI.SearchBox" 
    data-win-options="{onreceivingfocusonkeyboardinput : handler}">
</div>
function handler(eventInfo) { /* Your code */ }
 
// addEventListener syntax
searchBox.addEventListener("receivingfocusonkeyboardinput", handler);
searchBox.removeEventListener("receivingfocusonkeyboardinput", handler);

Event information

Synchronous No
Bubbles Yes
Cancelable Yes

 

Event handler parameters

  • eventInfo
    Type: CustomEvent**

    An object that contains information about the event. The detail property of this object contains the following sub-properties:

    • detail.propertyName

Remarks

Apps that want "type-to-search" behavior should handle this event and synchronously ensure the control is visible before the event call completes. After this event is raised, the control will set focus to itself.

Requirements

Minimum WinJS version

WinJS 3.0

Namespace

WinJS.UI

See also

SearchBox