spotlight/ Spottable
Exports the spotlight/Spottable.Spottable Higher-order Component and
the spotlight/Spottable.spottableClass className
. The default export is
spotlight/Spottable.Spottable.
import Spottable from '@enact/spotlight/Spottable';
Members
SpottableHigher-Order Component
Constructs a Spotlight 5-way navigation-enabled Higher-order Component.
Example:
const SpottableComponent = Spottable(Component);
import Spottable from '@enact/spotlight/Spottable';
Configuration
- emulateMouse
Whether or not the component should emulate mouse events as a response to Spotlight 5-way events.
Default: false
Properties added to wrapped component
- disabled
Whether or not the component is in a disabled state.
Default: false- onSpotlightDisappear
The handler to run when the component is removed while retaining focus.
- onSpotlightDown
The handler to run when the 5-way down key is pressed.
- onSpotlightLeft
The handler to run when the 5-way left key is pressed.
- onSpotlightRight
The handler to run when the 5-way right key is pressed.
- onSpotlightUp
The handler to run when the 5-way up key is pressed.
- spotlightDisabled
When
true
, the component cannot be navigated using spotlight.Default: false- tabIndex
The tabIndex of the component. This value will default to -1 if left unset and the control is spottable.
spottableClassstring
The class name for spottable components. In general, you do not need to directly access this class