ASP.NET AJAX RadChat - Change input textbox to textarea

1 Answer 86 Views
Chat
Gary
Top achievements
Rank 1
Gary asked on 18 Oct 2022, 08:15 AM
Is there any way I can work around ASP.NET AJAX RadChat control not having a setting for changing the single line input textbox (class=t-input) for message into a multi line textarea?

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 18 Oct 2022, 12:01 PM

Hi Gary,

I hope you are doing well!

Thank you for the useful feature request!

Currently, we are using <input type="text"> for a message input area and it does not support multiline capabilities. You can position a textarea with higher z-index over the input and attach its onchange or keydown event to update the input:

<telerik:RadChat runat="server" ID="RadChat1" Skin="Default" >
    <UserSettings Name="John" />
</telerik:RadChat>
<textarea onkeyup="textAreaAdjust(this)" ></textarea>
<script>
    var $ = $ || $telerik.$;

    function textAreaAdjust(o) {
        o.style.height = "1px";
        o.style.height = (25 + o.scrollHeight) + "px";
            $telerik.$(".t-input")[0].value = o.value;
    }
</script>

If you do not like the proposed workaround and its limitations, please do not hesitate to use the feedback portal to submit a feature request for it.

 

Regards,
Rumen
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Chat
Asked by
Gary
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or