Skip to content

Commit b5a9343

Browse files
Added remember for FocusRequester
1 parent 1f091ca commit b5a9343

File tree

1 file changed

+1
-1
lines changed
  • compose/snippets/src/main/java/com/example/compose/snippets/touchinput/focus

1 file changed

+1
-1
lines changed

compose/snippets/src/main/java/com/example/compose/snippets/touchinput/focus/FocusSnippets.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ private fun RequestFocus2() {
297297
private fun Capture() {
298298
var text by remember { mutableStateOf("") }
299299
// [START android_compose_touchinput_focus_capture]
300-
val textField = FocusRequester()
300+
val textField = remember { FocusRequester() }
301301

302302
TextField(
303303
value = text,

0 commit comments

Comments
 (0)