iOS InAppBrowser not showing HTML select properly

烂漫一生 提交于 2019-12-12 02:46:45

问题


I'm building an app using Ionic 2.

Not sure if this is related to Ionic 2 or Cordova, but maybe you can guide me in the right direction.

I'm using an InAppBrowser component to show an HTML page which have an HTML select component, and when the options are shown in iOS the "done" button is not shown, so a selection can't be made.

This is happening in the emulator and in a real device. It works fine in android.

I'm attaching an image just in case, but I did reproduce this in other websites too.

Screenshot


回答1:


document.addEventListener("deviceready", onDeviceReady, false);

function onDeviceReady() {
 window.cordova.plugins.Keyboard.hideKeyboardAccessoryBar(false);          
};



回答2:


This is because iOS needs the extra InAppBrowser Option: presentationstyle: "formsheet", to render those buttons:

this.inAppBrowser.create(
    url,
    target,
    {
        presentationstyle: "formsheet", // iOS only option
    },
);

As described in this answer, which answers basically the same question: https://stackoverflow.com/a/51149158/10005883



来源:https://stackoverflow.com/questions/40594119/ios-inappbrowser-not-showing-html-select-properly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!