Set ion-button height with percentage + keyboard show

My problem is I have a screen login, with inputs and login button vertically alligned. The heights are configured with percentage and shows fine but when I click on a input the keyboard shows, all elements that are configured with percentages reduces their height.

Is there any way to set the height of a element, i.e ion-button with percentage and then maintain this size when the keyboard is present


I can not believe that nobody has solved this problem :sweat:

In fact, I had the same problem, I tried via config nothing worked, and I had no time to waste so I just “brute force” by forcing the size like a pig

Same ‘workaround’ :triumph:

The problem is when this ‘pigged sizes’ are shown on a small screens, in the case of a login page it causes scroll content…:roll_eyes:

I have already tried with some combinations of:

scrollAssist: false,
scrollPadding: false,
autoFocusAssist: false,

With no lucky :persevere:

it causes scroll content

Is it ?
disclamer : you can be blind after seeing this
What I did to fix it, Im not proud of it but, you know… If it works…

this.sizeElement = this.platform.height()/100*7;

and just added an override on the event when screen rotate…

If someone has the real fix, I would like to see it, I have tried a whole bunch of config fix and others stuffs but really nothing has worked for me. It still torments me when I see this code.

How apply this to the original size of the element?, for example if the a button has 48px of height…

If they have a size defined they are not moving when the keyboard is showing, are they ?

If the elements have the size defined with px they not resizing when keyboard is showing

So you want to change the size of elements when the keyboard is here ? I thought you wanted the page staying the same

Oh sorry then, you apply this:

this.sizeElement = this.platform.height()/100*7;

when the keyboard is showing, no?

But, over what?

I apply it in the construct,
this.platform.height()/100*7 = 7% of the size screen