<focusoverlay>
an abstract class for the focus indicator

JavaScript: lz.focusoverlay
extends <basefocusview> » <view> » <node> » lz.Eventable »

An abstract base class that responds to focus by animating to the focused view and sizing itself to that view. A subclass of this view may be used to override the default look and feel of the focus indicator.

By default, a class called focusoverlay is used which highlights the corners of the focused view and adds a bounce animation when it arrives at the focusable view. To override this behavior and use your own class, set canvas.focusclass to the name of a class that extends basefocusview. To make it so there is no visual focus indicator set the canvas' focusclass attribute to null.

In some browsers you need to click on the application before keyboard navigation will work. You can experiment with the example below. Tab and shift-tab will move the focus between components. Space will activate the checkbox. Return or space will activate the button.

Example 57. Custom Focus Indicator

<canvas height="120">
              <class name="myfocusclass" extends="basefocusview">
                <view bgcolor="blue" y="${parent.height+1}" height="2" width="${parent.width}"/>
              </class>
            
              <attribute name="focusclass" value="myfocusclass" type="string"/>
              <view x="20" y="20">
                <simplelayout spacing="10"/>
                <checkbox>I would like fries with that</checkbox>
                <checkbox>Rush delivery</checkbox>
                <button>Order</button>
              </view>
            </canvas>

Attributes

Name (CSS property) Type (tag) Type (js) Default Category
offset expression any 5 read/write
  the offset is used by the brackets to 'offset' themselves from the bounding rect of the focusoverlay. The bounce effect is achieved by animating this parameter

Attributes inherited from <basefocusview>

active, duration, target

Methods

bounce()
focusoverlay.bounce();
the expand and contract effect of the focus brackets with each new focus - called by doFocus

doFocus()
focusoverlay.doFocus(v : lz.view);
overrides base method to add a bounce effect as the brackets move from view to view
Parameter Name Type Description
v lz.view The view that will receive the focus

Methods inherited from lz.Eventable

destroy, setAttribute

Events

Events inherited from <node>

onconstruct, ondata, oninit

Events inherited from lz.Eventable

ondestroy