reason:
in IOS, Safari are now apparently remembering that element was focussed and not actually focussing it until a touch Down event.
It's then blindly sending a click event to whichever element received the touch up.
only events that are actively triggered by the user in iOS enable focus to take effect, so you can use the focus () method in events triggered by users before Focus
like the HTML in Vue:
<p id= "Click-ele" > Click to review </p>
<input id= "input" v-show= "Isinputshow" type= "text" ></input>
JS as follows:
document.getElementById (' Click-ele '). AddEventListener (' click ', Function () {
Vue.isinputshow = True
document.getElementById (' input '). Focus ()
},false)
after clicking on the comment, the input tag can focus and the keyboard will jump out.
Note that there are two points:
(1) Document.getelement to mounted that the DOM structure is rendered good after the use, otherwise not get the element.
(2) P label directly using the @click= "Handlerclick" event in Vue will not take effect, the reason is unknown, with the original event is not a problem.
Apple mobile focus has no effect keyboard can't jump out