mirror of
https://github.com/marko-js/marko.git
synced 2026-02-01 16:07:13 +00:00
Fix loosing cursor position in Edge
See: https://github.com/patrick-steele-idem/morphdom/pull/100
This commit is contained in:
parent
292643de78
commit
c40e07a4ca
@ -42,14 +42,17 @@ module.exports = {
|
||||
fromEl.value = newValue;
|
||||
}
|
||||
|
||||
if (fromEl.firstChild) {
|
||||
var firstChild = fromEl.firstChild;
|
||||
if (firstChild) {
|
||||
// Needed for IE. Apparently IE sets the placeholder as the
|
||||
// node value and vise versa. This ignores an empty update.
|
||||
if (!newValue && fromEl.firstChild.nodeValue == fromEl.placeholder) {
|
||||
var oldValue = firstChild.nodeValue;
|
||||
|
||||
if (oldValue == newValue || (!newValue && oldValue == fromEl.placeholder)) {
|
||||
return;
|
||||
}
|
||||
|
||||
fromEl.firstChild.nodeValue = newValue;
|
||||
firstChild.nodeValue = newValue;
|
||||
}
|
||||
},
|
||||
SELECT: function(fromEl, toEl) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user