input fields move upper - Forum

Forum Navigation
You need to log in to create posts and topics.

input fields move upper

Hello

I have built an app which works well on computer and tablet. But on a mobile phone, inside a browser or as PWA, I have a problem with the input fields because they moved too high when the keyboard is invoked.

All my fields are inside a container. I tried to use CSS position without success.

Do you have an idea to fix the position ?

Uploaded files:
  • You need to login to have access to uploads.

@phil78 , try this:

https://stackoverflow.com/questions/47798279/jquery-mobile-how-to-detect-if-mobile-virtual-keyboard-is-opened

but for your case i think you should review the options of the container and the responsive properties of the app.

@phil78 this problem has been discussed many times here. Please uncheck "Project > Properties > Size > Auto-size content" and use FitAppToScreen command instead. Regards.

my project properties has no size properties. the app size is 320 x 600.

My code on app event is the following :

neoDeviceGetInfo [Ecran] [OS] [Orientation] [Navigateur]

If [Ecran] == "Mobile"
FitAppToScreen false "top" "center"
.slScaleAppFitWidth 330 600
Endif

IsInstalled [pwaInstall]

If [pwaInstall] == true
HideObject "Headline4" "none" 0
If [Ecran] != "Mobile"
ResizeDesktopWindow 350 600
Endif
Else
PreventInstallPrompt [readyToInstall]
Watch [readyToInstall] "customInstall"
Endif

On page enter i have tried SetKeyboard "TextInput1" "numeric" , hoping to reduce the size of the keyboard, but I don't get a numeric keyboard.

@phil78 in order to be able to help you, I need to take a look at your app, or even better to a simplified sample showing just the problem.
Regards.

@luishp I have also added some code found on the forum without success like

SetVar [h] [NAB.ClientHeight]
SetVar [w] [NAB.ClientWidth]

If [Ecran] == "Mobile"
SizeObject "[NAB.PageID]" [w] [h]
Endif

Uploaded files:
  • You need to login to have access to uploads.

@phil78 please test the attached sample app. I have included this code into Project > Events > Start-up:

FitAppToScreen false "top" "center"
SetKeyboard "TextInput1" "numeric"

Regards.

Uploaded files:
  • You need to login to have access to uploads.

@luishp thanks Luis. I have tested but there is no difference, the keyboard is not numeric only and the input field is not totally visible. When we put SetKeyboard at startup there is an error on GetDocumentByID, but not if we put on page Score (but without effect).

Have you successfully tested with a mobile phone on your side ?

@luishp   Sorry Luis, I just tested on another mobile and on mine with another browser and it works normally
There is probably a memory cache problem with the Samsung internet browser.

luishp has reacted to this post.
luishp

Thanks again to Luis and Emmanuel-Fernandez.

Here is the final version. For those of you who like to play belote, you can freely use this program and translate it into your language, but please don't remove the logo and the copyright

Uploaded files:
  • You need to login to have access to uploads.
luishp has reacted to this post.
luishp