Skip to main content
Ionic

Ionic V1: Show form accessory bar conditionally on iOS

By October 16, 2019January 14th, 2020No Comments

With WKWebView having form accessory bar has problems with keyboard. However, for select dropdown it is essential to have that Done bar. The Done helps make the selection in iOS otherwise you need to tap on the select field itself that initiated the rolling box. Not many people knows about it. Here’s how you conditionally show form accessory bar only for select.

1
2
3
4
5
6
7
8
9
10
11
            if (ionic.Platform.isIOS()) {

                angular.element('body').on('touchstart focus', 'select', function (e) {
                    Keyboard.hideFormAccessoryBar(false);
                });

                angular.element('body').on('blur', 'select', function (e) {
                    Keyboard.hideFormAccessoryBar(true);
                });

            }