Focus locations
ReactGrid has two properties related to focus location inside the grid via ReactGrid
:
focusLocation
initialFocusLocation
initialFocusLocation
property
You can set focus location at the first render of ReactGrid. Then this property is used no more.
<ReactGrid
{...props}
initialFocusLocation={{ columnId: 'col-2', rowId: 'row-2' }} //highlight-line
/>
focusLocation
property
- Defining
focusLocation
property is superior to pointer and keyboard actions, so you have to manage it all over time. - If
focusLocation
property has falsy value then it is ignored. - Defined
initialFocusLocation
is immediately overridden byfocusLocation
<ReactGrid
{...props}
initialFocusLocation={{ columnId: 'col-3', rowId: 'row-3' }} //highlight-line
focusLocation={{ columnId: 'col-2', rowId: 'row-2' }} //highlight-line
/>