In the development of ios browser input control to get focus, it takes a certain amount of time to click, so users often cannot successfully get focus at one time. The improvement method is very simple. Wrap a div around the input control and add a click event to the div to manually get focus for the input.
Take vUE code for example
Temp template:
<div @click="inputClicked" >
<input ref="phoneInput" >
</div>
Copy the code
script:
inputClicked() {
if (this.$refs.phoneInput) {
this.$refs.phoneInput.focus(); }}Copy the code