If this dropdown is loaded in a WebView it only shows the select-element. By clicking on the box nothing happens. If there is an "click"-eventlistener to this box, calling an alert, it shows this alert and after clicking the alert away the list shows up. It looks like the list is hidden by the WebView. Please help!
<select type="selector" class="selector" id="systemSelector" style="top: 30px;">
<option value="0">Value</option>
<option value="1">Value</option>
<option value="2">Value</option>
<option value="3">Value</option>
<option value="4">Value</option>
<option value="5">Value</option>
</select>
And if there are inputs field, by clicking in an input fields, it shows the keyboard. Right after the keyboard shows up by clicking on the select box, all options are shown as well.
The solution looks in my code like this:
At top of the .m-file you put:
#define IS_IOS8_3_AND_LOWER (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_8_3)
In @implementation you put:
#if IF_IS_IOS8_3_AND_LOWER
/* Workaround for Apple bug (UIPopoverPresentationController ... should have a non-nil sourceView ...). */
- (void)presentViewController:(UIViewController *)viewControllerToPresent animated:(BOOL)flag completion:(void (^)(void))completion {
// Load resources for iOS 8.3 or earlier
if ([viewControllerToPresent respondsToSelector:@selector(popoverPresentationController)]) {
if (viewControllerToPresent.popoverPresentationController && !viewControllerToPresent.popoverPresentationController.sourceView) {
return;
}
}
[super presentViewController:viewControllerToPresent animated:flag completion:completion];
}
#endif