Page MenuHomePhabricator

D14688.id.diff
No OneTemporary

D14688.id.diff

diff --git a/src/view/form/control/AphrontFormTextAreaControl.php b/src/view/form/control/AphrontFormTextAreaControl.php
--- a/src/view/form/control/AphrontFormTextAreaControl.php
+++ b/src/view/form/control/AphrontFormTextAreaControl.php
@@ -71,6 +71,15 @@
$classes[] = $this->customClass;
$classes = trim(implode(' ', $classes));
+ // NOTE: This needs to be string cast, because if we pass `null` the
+ // tag will be self-closed and some browsers aren't thrilled about that.
+ $value = (string)$this->getValue();
+
+ // NOTE: We also need to prefix the string with a newline, because browsers
+ // ignore a newline immediately after a <textarea> tag, so they'll eat
+ // leading newlines if we don't do this. See T8707.
+ $value = "\n".$value;
+
return javelin_tag(
'textarea',
array(
@@ -83,9 +92,7 @@
'sigil' => $this->sigil,
'placeholder' => $this->getPlaceHolder(),
),
- // NOTE: This needs to be string cast, because if we pass `null` the
- // tag will be self-closed and some browsers aren't thrilled about that.
- (string)$this->getValue());
+ $value);
}
}

File Metadata

Mime Type
text/plain
Expires
Sat, Apr 12, 6:41 AM (3 d, 19 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7253380
Default Alt Text
D14688.id.diff (1 KB)

Event Timeline