[jira] [Commented] (OFBIZ-12184) Textarea fields do not expand when typing into them

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-12184) Textarea fields do not expand when typing into them

Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-12184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17287754#comment-17287754 ]

Pawan Verma commented on OFBIZ-12184:
-------------------------------------

Hi [~ddev]

What about this solution?
{code:java}
var textarea = document.getElementById("textarea");
if (textarea) {
    textarea.oninput = function() {
        textarea.style.height = "";
        textarea.style.height = Math.min(textarea.scrollHeight, 200) + "px";
    };
}
{code}

> Textarea fields do not expand when typing into them
> ---------------------------------------------------
>
>                 Key: OFBIZ-12184
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-12184
>             Project: OFBiz
>          Issue Type: Improvement
>            Reporter: ddev
>            Priority: Minor
>         Attachments: autoexpand-textarea.js
>
>
> When typing into a textarea field with a large number of lines, you often can only see 2 lines of text at a time. It would make sense to add it to the HTML specification, but for whatever reason that did not happen, so it must be done in javascript.
>  
> I am attaching a javascript file that includes one way of fixing it.  One way of loading this would be to include it via themes/common/widget/Themes.xml
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)