Page MenuHomePhabricator

D14688.diff
No OneTemporary

D14688.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
Sun, May 12, 4:44 AM (3 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6289230
Default Alt Text
D14688.diff (1 KB)

Event Timeline