-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Closed
Description
Version
2.5.3
Reproduction link
https://jsfiddle.net/jacobgoh101/y1L2v9d4/
Steps to reproduce
- Click
show
button
What is expected?
input#timing
should be focused
What is actually happening?
input#timing
was focused, but something else cause it to blur immediately
Bug discovered from this Stack Overflow question together with acdcjunior.
from this example https://jsfiddle.net/acdcjunior/srfse9oe/1/ , after clicking on show
button, the console log these
beforeUpdate
inserted <div id="app"><div><p>a</p> <input type="number" id="timing"> <p>b</p> <button type="button">show</button> <p>c</p> <!----> <p>d</p></div></div>
updated
nextTick <div id="app"><div><p>a</p> <!----> <p>b</p> <!----> <p>c</p> <input type="number" id="timing"> <p>d</p></div> </div>
in inserted hook, input#timing
is between <p>a</p>
and <p>b</p>
. But in nextTick
callback, input#timing
has been moved to between <p>c</p>
and <p>d</p>
, for no particular reason. This caused the element to blur out.
See more details in this SO answer
acdcjunior
Metadata
Metadata
Assignees
Labels
No labels