Focus locations
ReactGrid has two properties related to focus location inside the grid via ReactGrid:
focusLocationinitialFocusLocation
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
focusLocationproperty is superior to pointer and keyboard actions, so you have to manage it all over time. - If
focusLocationproperty has falsy value then it is ignored. - Defined
initialFocusLocationis immediately overridden byfocusLocation
<ReactGrid
{...props}
initialFocusLocation={{ columnId: 'col-3', rowId: 'row-3' }} //highlight-line
focusLocation={{ columnId: 'col-2', rowId: 'row-2' }} //highlight-line
/>