Skip to content

Commit 4fb2d81

Browse files
committed
Copy value property from the mutating element not the other way around
1 parent 8dc7b0c commit 4fb2d81

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module.exports.update = function (fromNode, toNode, opts) {
2828
}
2929
// copy values for form elements
3030
if ((f.nodeName === 'INPUT' && f.type !== 'file') || f.nodeName === 'SELECT') {
31-
if (t.getAttribute('value') === null) t.value = f.value
31+
if (t.getAttribute('value') === null) f.value = t.value
3232
} else if (f.nodeName === 'TEXTAREA') {
3333
if (t.getAttribute('value') === null) f.value = t.value
3434
}

0 commit comments

Comments
 (0)