forked from javierjulio/textarea-autosize
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparams.json
1 lines (1 loc) · 2.19 KB
/
params.json
1
{"name":"textarea-autosize","tagline":"Vertically adjust a textarea based on user input without using a clone or ghost element.","body":"# textarea-autosize\r\n\r\nThis is a jQuery plugin for enabling vertically adjusting textarea's through user input *without* using a clone or ghost element.\r\n\r\nSo why build this? Many solutions didn't feel smooth. In some the textarea would flicker on entering new lines with a noticeable delay in resizing. Most were outdated and all were a lot bulkier than they had to be. Many had to use a mirror textarea or ghost element with some needing presentation values set in script. I wanted just the behavior in the script. Anything regarding presentation should be in CSS.\r\n\r\n## Usage\r\n\r\nLoad the plugin and use jQuery to find the desired `textarea` elements on which to call the plugin method.\r\n\r\n ```html\r\n <textarea class=\"js-auto-expand\" rows=\"1\"></textarea>\r\n\r\n <script src=\"http://code.jquery.com/jquery-2.1.0.min.js\"></script>\r\n <script src=\"jquery.textarea_autosize.min.js\"></script>\r\n <script>\r\n $('textarea.js-auto-expand').textareaAutoExpand();\r\n </script>\r\n ```\r\n\r\nUse a desired default number of text rows in conjunction with the required CSS below.\r\n\r\n### CSS Requirements\r\n\r\nSet the `textarea` to `box-sizing: border-box` and give it a `min-height`. In the example below, the minimum height is one line of text which is determined from the base font-size and line-height. Use a larger minimum height to have more initial rows and once enough text lines are entered the textarea will auto expand from that point on as expected.\r\n\r\n ```css\r\n textarea {\r\n box-sizing: border-box;\r\n max-height: 94px;\r\n min-height: 31px;\r\n }\r\n ```\r\n\r\nThe `max-height` style is only necessary if you don't want the textarea to grow past a certain point.\r\n\r\n## Browsers Tested\r\n\r\nUnless specified, all browsers listed were the latest versions.\r\n\r\n* Mac\r\n * Chrome\r\n * Safari\r\n * Firefox\r\n * IE9-10 (using VirtualBox and [ievms](https://github.com/xdissent/ievms))\r\n* Windows\r\n * TODO\r\n","google":"","note":"Don't delete this file! It's used internally to help with page regeneration."}