feat: Add auto-resizing to comment textareas
This commit is contained in:
1 parent
0e72252d62
commit
a88e18c29b
3 files changed
+23
-3
No files matched your search
@@ -56,7 +56,13 @@
|
||||
<form>
|
||||
<div class="mb-4">
|
||||
<div>
|
||||
<textarea class="w-full text-primary text-sm px-3 py-2 bg-transparent border-b-2 border-gray-300 focus:outline-none focus:border-primary transition duration-150 ease-in-out placeholder:text-xs" id="comment-body" name="body" placeholder="Enter your comment" required></textarea>
|
||||
<textarea class="w-full text-primary text-sm px-3 py-2 bg-transparent border-b-2 border-gray-300 focus:outline-none focus:border-primary transition duration-150 ease-in-out placeholder:text-xs resize-none overflow-hidden"
|
||||
id="comment-body"
|
||||
name="body"
|
||||
placeholder="Enter your comment"
|
||||
oninput="this.style.height = 'auto'; this.style.height = this.scrollHeight + 'px';"
|
||||
required>
|
||||
</textarea>
|
||||
</div>
|
||||
<p class="mt-1 text-xs text-text-muted">Must be at least 8 characters long.</p>
|
||||
</div>
|
||||
|
||||
@@ -41,7 +41,14 @@ layout: default
|
||||
<div class="mb-4">
|
||||
<label class="block font-medium text-sm mb-1" for="comment-body">Comment:</label>
|
||||
<div>
|
||||
<textarea class="w-full text-primary text-sm px-3 py-2 bg-transparent border-b-2 border-gray-300 focus:outline-none focus:border-primary transition duration-150 ease-in-out placeholder:text-xs" id="comment-body" name="body" placeholder="Enter your comment" required></textarea>
|
||||
<textarea class="w-full text-primary text-sm px-3 py-2 bg-transparent border-b-2 border-gray-300 focus:outline-none focus:border-primary transition duration-150 ease-in-out placeholder:text-xs resize-none overflow-hidden"
|
||||
id="comment-body"
|
||||
name="body"
|
||||
placeholder="Enter your comment"
|
||||
oninput="this.style.height = 'auto'; this.style.height = this.scrollHeight + 'px';"
|
||||
required>
|
||||
</textarea>
|
||||
<p class="mt-1 text-xs text-text-muted">Must be at least 8 characters long.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
|
||||
@@ -44,7 +44,14 @@ layout: default
|
||||
<div class="mb-4">
|
||||
<label class="block font-medium text-sm mb-1" for="comment-body">Comment:</label>
|
||||
<div>
|
||||
<textarea class="w-full text-primary text-sm px-3 py-2 bg-transparent border-b-2 border-gray-300 focus:outline-none focus:border-primary transition duration-150 ease-in-out placeholder:text-xs" id="comment-body" name="body" placeholder="Enter your comment" required></textarea>
|
||||
<textarea class="w-full text-primary text-sm px-3 py-2 bg-transparent border-b-2 border-gray-300 focus:outline-none focus:border-primary transition duration-150 ease-in-out placeholder:text-xs resize-none overflow-hidden"
|
||||
id="comment-body"
|
||||
name="body"
|
||||
placeholder="Enter your comment"
|
||||
oninput="this.style.height = 'auto'; this.style.height = this.scrollHeight + 'px';"
|
||||
required>
|
||||
</textarea>
|
||||
<p class="mt-1 text-xs text-text-muted">Must be at least 8 characters long.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
|
||||
Reference in new issue
Block a user