focus Row
Moves keyboard focus to the row with the given key, or clears focus when key is null.
The key must be one produced by DataTable's itemKey. Focusing a key that is not currently displayed — filtered out, or on another page — is harmless: no row draws the focus indicator, and the next arrow key starts again from the first row.
This only moves focus; it does not scroll. To bring the row into view as well, pair it with animateScrollToItem using the row's position in the list you passed to DataTable:
val position = people.indexOfFirst { it.id == personId }
state.focusRow(personId)
if (position >= 0) state.animateScrollToItem(position)Content copied to clipboard