Thread
#compose
    b

    Bradleycorn

    1 year ago
    is there a way to focus a composable (specifically a TextField) in a
    @Preview
    ? I tried adding a focus requester and requesting focus in a DisposableEffect, but as I suspected, no luck.
    Chris Johnson

    Chris Johnson

    1 year ago
    Try
    LaunchedEffect
    for focusing.
    DisposableEffect
    doesn't give the composable enough time to layout before it requests focus.
    LaunchedEffect
    should.
    b

    Bradleycorn

    1 year ago
    @Chris Johnson - Thanks, but Launched Effect doesn’t seem to work either.
    Chris Johnson

    Chris Johnson

    1 year ago
    Must be a Preview specific thing. 😞 LaunchedEffect does work for me in a regular composable.