Hanzo
August 10, 2018, 8:28am
1
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
Thanks
Hanzo
August 13, 2018, 6:18am
2
I can not believe that nobody has solved this problem
kocei
August 13, 2018, 7:40am
3
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
Hanzo
August 13, 2018, 7:46am
4
Same ‘workaround’
The problem is when this ‘pigged sizes’ are shown on a small screens, in the case of a login page it causes scroll content…
I have already tried with some combinations of:
{
scrollAssist: false,
scrollPadding: false,
autoFocusAssist: false,
}
With no lucky
kocei
August 13, 2018, 7:52am
5
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;
[style.height.px]="sizeElement"
and just added an override on the event when screen rotate…
kocei
August 13, 2018, 8:01am
6
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.
Hanzo
August 13, 2018, 8:03am
7
How apply this to the original size of the element?, for example if the a button has 48px of height…
kocei
August 13, 2018, 8:08am
8
If they have a size defined they are not moving when the keyboard is showing, are they ?
Hanzo
August 13, 2018, 8:10am
9
If the elements have the size defined with px they not resizing when keyboard is showing
kocei
August 13, 2018, 8:11am
10
So you want to change the size of elements when the keyboard is here ? I thought you wanted the page staying the same
Hanzo
August 13, 2018, 8:16am
11
Oh sorry then, you apply this:
this.sizeElement = this.platform.height()/100*7;
[style.height.px]="sizeElement"
when the keyboard is showing, no?
But, over what?
kocei
August 13, 2018, 8:17am
12
I apply it in the construct,
this.platform.height()/100*7 = 7% of the size screen