n

    nglauber

    10 months ago
    Hello… Is there any workaround to make
    BringIntoViewRequester
    works in the following situation:1.
    TextField
    is at the bottom of the screen and the user tap on it and it gain focus. 2. System keyboard is displayed and the
    TextField
    becoming visible because of the following:
    Modifier.bringIntoViewRequester(bringIntoViewRequester)
    .onFocusChanged {
        if (it.isFocused) {
            coroutineScope.launch {
                delay(300)
                bringIntoViewRequester.bringIntoView()
            }
        }
    }
    3. The user now press the system back key and the keyboard is closed, but the
    TextField
    still has focus. 4. Finally, if the user tap on the
    TextField
    again. The keyboard is opened on top of the
    TextField
    and the
    BringIntoViewRequester
    is not triggered again because the focus haven’t changed. I know there’s a ticket kinda related to this…https://issuetracker.google.com/u/0/issues/192043120 Any suggestion?
    rsktash

    rsktash

    10 months ago
    You should use another event called
    onFocusEvent
    n

    nglauber

    10 months ago
    onFocusEvent
    is triggered several times.
    rsktash

    rsktash

    10 months ago
    .onFocusEvent { state ->
      if (state.isFocused) { ...
    n

    nglauber

    10 months ago
    I remember that I have tried this before and didn’t worked. But I tried it now and worked… Let me see if I’ll get any bad side effect 🙂 Thanks @rsktash