syncEditCellFocus

Modifier extension that integrates an editable cell component with the table's focus management system.

This modifier performs two key functions:

  1. Applies the table's LocalEditCellFocusRequester to enable programmatic focus control (e.g., when navigating between cells with Tab/Enter or when starting edit mode)

  2. Synchronizes the component's focused state with ua.wwind.table.state.TableState.selectedCell, so clicking on the field updates the table's selection state and triggers cell visibility/scrolling

This ensures seamless integration with the table's cell selection and keyboard navigation system. TableCellTextField already applies this modifier internally, so you only need to use it explicitly with custom input components.

Example usage with custom TextField:

editCell { person, tableData, onComplete ->
var text by remember(person) { mutableStateOf(person.name) }

TextField(
value = text,
onValueChange = { text = it },
modifier = Modifier
.syncEditCellFocus() // Integrates with table focus management
.fillMaxSize()
)
}

Return

A Modifier that integrates the component with table's focus management system.