Hi there!
I’ve been working on an app recently and I’m trying Ionic to see how it goes.
I’m facing that when the virtual keyboard is opened, the footer remains at the bottom, so it’s no longer visible. I want the footer to ve visible at all times.
The weird part is that researching on Internet doesn’t bring any light since most people wants to avoid this behaviour. I’ve read about the fix you do on Android devices in which the footer get’s hidden but this is something different?
Do you have any hints?
1 Like
Which device are you running this on?
I am only aware of this being possible in Cordova + BlackBerry 10. The com.blackberry.app plugin allows you to detect the keyboardOpened event (when the virtual keyboard is opened): https://developer.blackberry.com/html5/apis/v2_0/blackberry.app.html
You can create an event listener that applies a CSS transformation to the footer element.
See if these posts help at all:
Hi,
I have fixed this issue by this workaround: In the ionic js there is a line …
document.body.classList.add(‘hide-footer’);
I have removed this line, then it works.
Regards,
Mike
Hi,
I tried something but I wanted to know if there is easier/better way.
Basically, I added a sub-footer:
<div class="bar bar-subfooter">
<div class="list">
<div class="item item-input-inset">
<label class="item-input-wrapper">
<textarea placeholder="Comments"></textarea>
</label>
<button class="button button-small button-positive">
Send
</button>
</div>
</div>
</div>
An…
item-input-inset uses relative positioning; so, it should happily put it wherever bar-footer ends up being. Strange though.
Can you share that CodePen sample?
I just tested on mine as well and got similar results. However, I think I have a fix for it:
<div class="bar bar-footer item-input-inset footer-item-input-insert" ng-if="mc.showSendMsgForm">
<label class="item-input-wrapper">
<input type="search" placeholder="Message" ng-model="msg.text" maxlength="500">
…
I’m circumventing this right now with this:
.keyboard-open {
.bar-footer {
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -moz-flex;
display: -ms-flexbox;
display: flex;
// iPhone 5
@media screen and (device-aspect-ratio: 40/71) and (-webkit-min-device-pixel-ratio: 2) { bottom: 216px; }
// iPhone 4
@media screen and (device-aspect-ratio: 2/3) and (-webkit-min-device-pixel-ratio: 2) { bottom: 216px; }
}
}
ariera
March 5, 2015, 6:14pm
6
For the shake of completion. The current ionic way of doing this is using the new keyboard-attach
directive.
http://ionicframework.com/docs/api/directive/keyboardAttach/
2 Likes