Use value attr for textarea
Because setting content as child text node seems to confuse Mithril. I suspect that's because it uses 'value' property to get/set textarea content.
This commit is contained in:
1 parent
109ea05fc2
commit
3e455d6cbc
1 file changed
+3
-8
@@ -15,21 +15,16 @@ const component = {
|
|||||||
title: text,
|
title: text,
|
||||||
onclick: () => {
|
onclick: () => {
|
||||||
overlay.open(() => {
|
overlay.open(() => {
|
||||||
return m(
|
return m("textarea.long-text", {
|
||||||
"textarea.long-text",
|
value: text,
|
||||||
{
|
|
||||||
cols: 80,
|
cols: 80,
|
||||||
rows: 24,
|
rows: 24,
|
||||||
readonly: "",
|
readonly: "",
|
||||||
oncreate: vnode2 => {
|
oncreate: vnode2 => {
|
||||||
setTimeout(() => {
|
|
||||||
vnode2.dom.focus();
|
vnode2.dom.focus();
|
||||||
vnode2.dom.select();
|
vnode2.dom.select();
|
||||||
}, 50);
|
|
||||||
}
|
}
|
||||||
},
|
});
|
||||||
text
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in new issue
Block a user