Compartir a través de


WinJS.UI.XYFocus.focuschanging event

Raised before XYFocus changes focus. The HTMLElement.focus method does not trigger this event. When you handle this event, can use preventDefault to cancel the focus change.

Syntax

function handler(eventInfo) { /* Your code */ }
 
// addEventListener syntax
winJS.UI.XYFocus.addEventListener("focuschanging", handler);
winJS.UI.XYFocus.removeEventListener("focuschanging", 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.nextFocusElement
      Type: HTMLElement

      The element to receive focus.

    • detail.keyCode
      Type: Number

      The key code that triggered the focus change.

Remarks

After the moveFocus() function has been called, the focuschanging event fires. Once the new element has focus, the focuschanged event fires.

Requirements

Minimum WinJS version

WinJS 3.0

Namespace

WinJS.UI.XYFocus

See also

WinJS.UI.XYFocus