Avoid keyboard covering text input

I know this has been discussed before (e.g. here).

@jared’s example works great but I’d like to stick to the built-in text input and more importantly, I want whatever input field there is to be at the bottom of the screen, not at the middle or top.

I modified the first screen in his demo project to make the screen scrollable and add a text input to a group: Thunkable

It works! Sort of. I can’t click on the text input to focus it because the group gets in the way (I assume). If I make the text input auto-focus, the effect is the way I want it to be where I can type and the text input moves up as the keyboard is displayed. But I don’t want auto-focus.

So what’s a possible solution to this?

One not bad option I have been playing around with is to add an empty invisible group or (if you’re using Layouts) invisible container that essentially “props up” the text input when it is selected so that it floats just above the keyboard.

Here is a small demo app. Container 3 is set to invisible and has a fixed height of 100px. When I click on the text input, Container 3 is then set to visible.

https://x.thunkable.com/copy/2e1399deedb55eef4702d35cd719889f

1 Like

Thank you! That’s a useful method. I still need something that can expand for multi-line entry but I may just use my own solution for that.

It doesn’t seem to work for the very bottom of the screen which is where I want the text input. Or maybe I need to adjust the container size?

In the Bing app on an iPhone, the text field is almost all the way at the bottom of the screen:

That’s what I’m aiming for. But when I move the container you created to be flush with the bottom of the screen, the text input component gets blocked by the pop-up iPhone keyboard.

Edit: Oh, I was taking the project at face value even though you explained the hidden container. Let me go back and see if I can figure out what needs to be adjusted.

Edit #2: Ah, just the height of container 3. I changed it from 100 to 150 pixels and it works now.

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.