I am using the ionic framework to create my app and I use a lot of forms with modals. In order to move between fields a user normally taps on the space where there isn't any image however this can lead to unexpected behaviour.
I would like a button to hide the keyboard exactly like the image below.
If you are using cordova, you can first install this plugin
cordova plugin add com.ionic.keyboard
Then, in your callback, initiate
cordova.plugins.Keyboard.close();
Some information regarding attaching an element above the keyboard.
keyboard-attach is an attribute directive which will cause an element
to float above the keyboard when the keyboard shows. Currently only
supports the ion-footer-bar directive.
On iOS, if there is an input in your footer, you will need to set
cordova.plugins.Keyboard.disableScroll(true)
The Usage
<ion-footer-bar align-title="left" keyboard-attach class="bar-assertive">
<h1 class="title">Title!</h1>
</ion-footer-bar>
Related
I have an iOS app written using Capacitor.
I have buttons which are links to different part of the application.
If I do a long press over some button then drag it the iOS shows a popup block exposing the internal link, something like "capacitor://...."
Is there any way to disable this behaviour?
I can change every link and replace href with onclick method but I wonder if there is an option somewhere in Xcode to do it for all links.
When I use just plain ActionBar:
<ActionBar/>
when I changing route with:
this.$navigateTo(Catalog)
the native ios Back button appears normally,
but when I change action-bar like this:
<ActionBar title="some title"/>
or put other elements inside action-bar like this:
<ActionBar>
<NavigationButton text="Go back" android.systemIcon="ic_menu_back" #tap="goBack" />
<ActionBar/>
the default native ios Back button disappearing.
What I need in the end is default ios action-bar with custom title and native ios back button that appears when I navigate between components. Please help, thanks in advance!
Solved my problem. I was using ActionBar in my main component(where tabs where defined). Instead, I removed it from my main component and added its own ActionBar for every component. That solved the problem. Now the default ios back-button displaying properly with any other combinations of params or nested elements and it doesn't matter wether you route to frame of same component or not.
I'm unable to reproduce the issue on my end, the NavigationButton is still visible when I use the exact code snippet above, tested with iOS v12.1.4. Please share the Playground sample if you still have the issue on your end.
However, you will not be able to modify the tap handler on iOS as mentioned in the docs.
In iOS, the back button is used explicitly for navigation. It
navigates to the previous page and you cannot handle the tap event to
override this behavior.
If you want to place a button on the left side of the ActionBar and
handle the tap event (e.g., show slide-out), you can use ActionItem
with ios.position="left".
I have recently updated device to iOS 10 and facing issues with hiding iOS keypad when i switch from one view to another.It was working well with iOS 9.3.
Programmatically what i have done is, i was intercepting some element and auto focusing one input box when i navigate to second view. And when i move back to first view it was getting hidden but now with 10.0 it doesn't hide it automatically.
Because of privacy concern i am not able to post my code here but this is an angular code where i have written a directive which intercepts clicks on input box in the second view and auto focuses the same which in turn makes keypad popping up.
Now my requirement is to hide this keypad when i move back to first view.
As iOS 10 is very recently released any help or suggestion on this will be greatly appreciated.
N.B: Everything works well with iOS 8 and 9.
Here is what i have tried:
Tried hiding active DOM element.
document.activeElement.blur();
Also tried calling blur using target property of $element by passing that to my link function in the directive.
It looks like this is a bug in safari. I had the same issue today and was able to reproduce it with this fiddle:
https://jsfiddle.net/Lz652478/6/
It looks like if an input is removed from the dom via a touch event, the keyboard will become sticky. I've been able to get around it in my app by manually calling blur at the start of my event handler, before the route changes and the input is removed from the dom.
I am developing an app (IOS platform) using HTML5, CSS3, angular and cordova(3.8) and stuck with an major issue.
I have a page with footer having three buttons. On click of each button a modal comes up from the bottom. Modal position is set to fixed and inside it as scroll-able container. scroll-able container contains a text area where user can input some text.
Whenever the modal comes up, text area is focused so that keyboard comes up by default. The issue is whenever native keyboard comes up webview is pushed up and entire modal gets scrolled.
I saw same issues been posted by others and I tried few solutions mentioned in reply for those questions like using ionic keyboard plugin, setting scrollTop to 0 on textarea focus. But nothing worked out.
In config.xml, I have set DisallowOverscroll to true.
It would be great helpful if someone help me with this issue ?
I have making a phonegap app which have text fields in it.
Problem:- I want to remove the Done button from the keyboard or I want a Event listener of done button. Ether of the things will work for me.
My Problem is similar to this link
You can't remove the done button, since Phonegap uses a UIWebView to present the UI you will be stuck with keyboard used by the UIWebView.