Skip to content

Commit

Permalink
address contentEditable warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ohAitch committed Aug 25, 2015
1 parent 1680383 commit 437e416
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion urb/zod/pub/work/src/js/components/ItemComponent.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ Field = recl
if elem is 'textarea' then (textarea props)
else
props.contentEditable = true
(rece elem, props, props.defaultValue)
props.dangerouslySetInnerHTML =
__html: $('<div>').text(props.defaultValue).html()
(rece elem, props)

onKeyUp: (e) ->
$t = $(e.target).closest '.field'
Expand Down
1 change: 0 additions & 1 deletion urb/zod/pub/work/src/js/components/ListComponent.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ module.exports = recl
$title.focus()
if @state.select is "end"
r = window.getSelection().getRangeAt(0)
console.log @state.selected,$title
r.setStart $title[0],0
r.setEnd $title[0],0
s = window.getSelection()
Expand Down
5 changes: 3 additions & 2 deletions urb/zod/pub/work/src/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,9 @@ Field = recl({
});
return div({
className: className
}, elem === 'textarea' ? textarea(props) : (props.contentEditable = true, rece(elem, props, props.defaultValue)));
}, elem === 'textarea' ? textarea(props) : (props.contentEditable = true, props.dangerouslySetInnerHTML = {
__html: $('<div>').text(props.defaultValue).html()
}, rece(elem, props)));
},
onKeyUp: function(e) {
var $t, val;
Expand Down Expand Up @@ -827,7 +829,6 @@ module.exports = recl({
}
if (this.state.select === "end") {
r = window.getSelection().getRangeAt(0);
console.log(this.state.selected, $title);
r.setStart($title[0], 0);
r.setEnd($title[0], 0);
s = window.getSelection();
Expand Down

0 comments on commit 437e416

Please sign in to comment.