From 61529f3a8b72398845ed5680d3945d23bef7a840 Mon Sep 17 00:00:00 2001 From: Dominic Tarr Date: Sun, 16 Dec 2012 01:21:43 -0500 Subject: [PATCH] set initial value of text area --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 50e0ab3..0a5ea3b 100644 --- a/index.js +++ b/index.js @@ -30,7 +30,7 @@ var R = REdit.prototype R.text = function text (text) { if(!arguments.length) - return this.toJSON() + return this.toJSON().join('') var old = this.toJSON() text = split(text) @@ -88,5 +88,7 @@ R.wrap = function (ta) { ta.addEventListener('focus', function () { ta.selectionStart = ta.selectionEnd = start }) + ta.value = this.text() + return this }