8000 re-focus field after v-repeat moves the element · Snoopbobb/vue@7e2f8c1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7e2f8c1

Browse files
committed
re-focus field after v-repeat moves the element
1 parent d358b32 commit 7e2f8c1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/directives/repeat.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ module.exports = {
237237
*/
238238

239239
diff: function (data, oldVms) {
240+
var activeElement = document.activeElement
240241
var idKey = this.idKey
241242
var converted = this.converted
242243
var anchor = this.anchor
@@ -331,6 +332,9 @@ module.exports = {
331332
vm._new = false
332333
vm._reused = false
333334
}
335+
if (activeElement) {
336+
activeElement.focus()
337+
}
334338
return vms
335339
},
336340

0 commit comments

Comments
 (0)
0