File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -34,15 +34,26 @@ function isTrue (v) {
34
34
return v === true
35
35
}
36
36
37
- function sameVnode ( vnode1 , vnode2 ) {
37
+ function sameVnode ( a , b ) {
38
38
return (
39
- vnode1 . key === vnode2 . key &&
40
- vnode1 . tag === vnode2 . tag &&
41
- vnode1 . isComment === vnode2 . isComment &&
42
- ! vnode1 . data === ! vnode2 . data
39
+ a . key === b . key &&
40
+ a . tag === b . tag &&
41
+ a . isComment === b . isComment &&
42
+ isDef ( a . data ) === isDef ( b . data ) &&
43
+ sameInputType ( a , b )
43
44
)
44
45
}
45
46
47
+ // Some browsers do not support dynamically changing type for <input>
48
+ // so they need to be treated as different nodes
49
+ function sameInputType ( a , b ) {
50
+ if ( a . tag !== 'input' ) return true
51
+ let i
52
+ const typeA = isDef ( i = a . data ) && isDef ( i = i . attrs ) && i . type
53
+ const typeB = isDef ( i = b . data ) && isDef ( i = i . attrs ) && i . type
54
+ return typeA === typeB
55
+ }
56
+
46
57
function createKeyToOldIdx ( children , beginIdx , endIdx ) {
47
58
let i , key
48
59
const map = { }
You can’t perform that action at this time.
0 commit comments