Unable to attach two way data binding to a <div contenteditable>
tag. Here is the demo
html:
<body>
<div contenteditable style="height:40px;min-width:40px">{{content}}</div>
</body>
js:
if (Meteor.isClient) {
Session.setDefault('content', 'Try to edit me')
Template.body.helpers({
content: function () {
return Session.get('content')
}
})
Template.body.events({
'keydown div': function (e) {
setTimeout(function(){ Session.set('content', $(e.target).text()) })
}
})
}
There is also an open issue for this at github.