Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15489189
D14688.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D14688.id.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D14688: Add an extra newline after <textarea> to preserve textarea content beginning with newlines
Attached
Detach File
Event Timeline
Log In to Comment