Home Reference Source
public class | source

DomUtilities

General purpose DOM utilities.

Static Method Summary

Static Public Methods
public static

forceFocus(domElement: Element, maxAttempts: Number, pollIntervalMilliseconds: Number)

Force focus on a DOM element.

public static

hide(element: *)

public static

show(element: *, displayStyle: string)

Static Public Methods

public static forceFocus(domElement: Element, maxAttempts: Number, pollIntervalMilliseconds: Number) source

Force focus on a DOM element.

Works around timing issues with visibility and signals by trying multiple times with a short interval between each attempt.

Params:

NameTypeAttributeDescription
domElement Element

A DOM Element.

maxAttempts Number

Number of attempts to make. The first attempt is made at once, and the other attempts is performed each pollIntervalMilliseconds until we get focus, or we have used up the attempts.

pollIntervalMilliseconds Number

Numer of milliseconds between each attempt.

public static hide(element: *) source

Params:

NameTypeAttributeDescription
element *

public static show(element: *, displayStyle: string) source

Params:

NameTypeAttributeDescription
element *
displayStyle string
  • optional
  • default: block