Tuesday, 27 October 2020

HTML Drop Down not selecting options in iPhone's IOS 13

I implemented a web application and it has a drop down (i.e., HTML Select). If I tried to select any option in the drop down its not triggering the change event but its updates the label text successfully.

  • Device: iPhone 11 or latest version
  • OS: IOS 13 or latest version
  • Browser: Safari

Sample Code:

<select id="storagetype">
    <option value="" selected>Select Storage Type</option>
    <option value="1" selected>ABC</option>
    <option value="2" selected>XYZ</option>
</select>

JavaScript:

var storagetype = document.getElementById("storagetype");

storagetype.addEventListener("change", function() {
    alert(storagetype.value)
});

If I tried the same in IOS 12.X or lower version its working as expected.

Moreover there is no console error and I tried the style z-index. But nothing worked.

enter image description here



from HTML Drop Down not selecting options in iPhone's IOS 13

No comments:

Post a Comment