Ionic V1: Show form accessory bar conditionally on iOS

By October 16, 2019Uncategorized

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);
                });

            }
priyankmaniar

Author priyankmaniar

More posts by priyankmaniar