How to get focus from input in ios

try to use
1.vue "s custom instruction v-focus
2.input "s autofocus
3.this.$refs ["input"]. Focus ()
all three methods android can be used to get focus automatically, but ios is not allowed.

Aug.04,2021
Some events on

ios can only be triggered actively by users. The input focus event of ios can be triggered by http://feg.netease.com/archiv.


you can try binding click event on input. Emit click the event when you need to let input get focus.


solved
there was a problem before clicking focus
because the v-show instruction using vue was later rewritten to display:none (although I don't know why,

<div><button onclick="show()">Show Input</button></div>
<div><input style="display: none;" id="input" type="text"></div>
function show() {
    const input = document.querySelector('-sharpinput')

    input.style.display = 'block'
    input.focus()
}

before you call the focus method, nest a setTimeout (fn,10)

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3df86-2c3dd.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3df86-2c3dd.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?