Gelbooru

Notice: Do you have an artist tag on Gelbooru? Let us know so we can properly credit you!

Ticket Information - ID: #912


ID:Category:SeverityReproducibilityDate SubmittedUpdated By:
0000912Feature RequestLowN/A11/18/17 03:42PM
Reporterusernam
Assigned to:geltas
Resolution:Open
View StatusPublic
Version:
Target Version:N/A
Summary:Resize textarea based on the amount of text
Description:(This ticket is low priority because the main priority is to fix the aliasing system.)

The textarea should resize per the amount of text that it contains.

Test the following code here: http://htmledit.squarefree.com/

<html>
<!--
works for a small amount of text in a textarea...
-->

<textarea cols="100" id="tags" name="tags" rows="8" tabindex="10">kjdflksdjflkdsjflkdsjflksdjflkjdslkfjdsalkfjdsalkfjlksdjflkaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaskdkdkdkd</textarea>

<!--
and a large amount of text in a textarea:
<textarea cols="100" id="tags" name="tags" rows="8" tabindex="10">= Inventory Storage_Devices Conner_CFS1275A_HDD.txt = http://www.computerhope.com/hdd/hdd0015.htm __ ____ _ / | |__ \ ___ | |_ | | | | / || \ _| |_ __/ /_ | O || O | |_____|o|_______| \ ||___/ _| | |___| JUMPER SETTINGS SINGLE DRIVE MASTER DRIVE SLAVE DRIVE C AND D JUMPED C AND D JUMPED C AND D NOT JUMPED CMOS SETTINGS MODEL (CFS SERIES) SIZE CYL HDS SECT WPCOMP LZONE Type CFS1275A 1278 MB 2477 16 63 0 2477 IDE HARD DRIVE SPECIFICATIONS Physical Specifications Formatted Capacity (MB=1,000,000): 1275 Cylinders: 3640 Sectors: Heads: 4 Disks: 2 Buffer Size: 64KB, segmented, adaptive Average Seek: 14ms Single Track 3ms Rotation Speed/Avg. Latency 3600 rpm / 8.3ms Transfer Rate to/from. media up to 16.7 MB / Sec Transfer Rate to/from buffer TPI 4100 Tracks per inch BPI 93K Bits per inch Size 1.0" Height x 4.0" Wide x 5.75" Depth Weight 1.3 lbs POWER REQUIREMENTS +12 Volts +5 Volts Power read/write N/A N/A 4.2 W Seek N/A N/A 5.6 W Idle 3.9 W N/A 3.9 W Standby <1.0 W N/A 1.0 W Sleep N/A N/A 1.0 W Spin up (7 seconds) N/A N/A N.A. Additional information Steps on installing a PC IDE/EIDE hard drive. How to enter the BIOS or CMOS setup. See our hard drive and jumper definitions for further information and related links on these terms. Was this page useful? YesNo Feedback E-mail Share Print Recently added pages What is a Dataphone? What is a HoT?</textarea>
-->

<!--
The default scroll height of the "tags" textarea is 136 (per server-side code), check with:
alert(document.getElementById("tags").scrollHeight);
-->

<script>
//<thanks to="https://stackoverflow.com/questions/995168/textarea-to-resize-based-on-content-length">
var events =
"var ta = document.getElementById('tags');\
ta.addEventListener('keyup', function textAreaSize() {\
ta.style.height = '136px';\
ta.style.height = (25+ta.scrollHeight)+'px';\
});";
events += events.replace(/keyup/g, "load").replace(/ta.add/g, "window.add");
eval(events);
//</thanks>
</script>
</html>
Additional Info: