I'm trying to show a webView and its contents using WKWebView. I used the below code, and the webView shows its content. The thing is, there is a function to show an auto fill drop down when clicking a button/ textfield inside the webView. And which is working fine on android after enabling the javascript, But it doesn't work for me even if I enable the javascript as per the code below. (ref: https://stackoverflow.com/a/47038285/5416775)
private var webView: WKWebView!
let preferences = WKPreferences()
preferences.javaScriptEnabled = true
let configuration = WKWebViewConfiguration()
configuration.preferences = preferences
webView = WKWebView(frame: view.bounds, configuration: configuration)
And the function which the php team uses the below code to show the drop down dynamically.
$('input[name=\'option\']').autocomplete({
'source': function(request, response) {
$.ajax({
url: 'index.php?route=product/product_option/autocomplete&language_id=<?php echo $language_id; ?>&store_id=<?php echo $store_id; ?>&filter_name=' + encodeURIComponent(request),
dataType: 'json',
success: function(json) {
response($.map(json, function(item) {
return {
category: item['category'],
label: item['name'],
value: item['option_id'],
type: item['type'],
option_value: item['option_value']
}
}));
}
});
},
'select': function(item) {
html = '<div class="tab-pane" id="tab-option' + option_row + '">';
html += ' <input type="hidden" name="product_option[' + option_row + '][product_option_id]" value="" />';
html += ' <input type="hidden" name="product_option[' + option_row + '][name]" value="' + item['label'] + '" />';
html += ' <input type="hidden" name="product_option[' + option_row + '][option_id]" value="' + item['value'] + '" />';
html += ' <input type="hidden" name="product_option[' + option_row + '][type]" value="' + item['type'] + '" />';
if (item['type'] == 'checkbox') {
html += ' <div class="form-group">';
html += ' <label class="col-sm-12 control-label text-danger"><?php echo $entry_text_required; ?></label>';
html += ' </div>';
}
html += ' <div class="form-group" style="display: none;">';
html += ' <label class="col-sm-2 control-label" for="input-required' + option_row + '"><?php echo $entry_required; ?></label>';
html += ' <div class="col-sm-10"><select name="product_option[' + option_row + '][required]" id="input-required' + option_row + '" class="form-control">';
html += ' <option value="1"><?php echo $text_yes; ?></option>';
html += ' <option value="0"><?php echo $text_no; ?></option>';
html += ' </select></div>';
html += ' </div>';
html += ' <div class="form-group" style="display: none;">';
html += ' <label class="col-sm-2 control-label" for="input-option-sort-order' + option_row + '"><?php echo $entry_option_sort_order; ?></label>';
var option_row = <?php echo $option_row; ?>;
Any solution..? would be appreciated. Thanks..!