private fun TextFieldValue.isCursorAtTheEnd(): Boolean {val textLength = text.lengthval selectionStart = selection.startval selectionEnd = selection.endreturn textLength == selectionStart && textLength == selectionEnd}
Check if the [TextFieldValue] state represents a UI with the cursor at the end of the input.