Completed
Last Updated: 08 Jan 2021 08:50 by ADMIN
Release 2.21.0
René
Created on: 26 Oct 2020 08:59
Category: TextArea
Type: Feature Request
18
TextArea needs Width Parameter
We need to be able to change the width of the TextArea component.
8 comments
ADMIN
Svetoslav Dimitrov
Posted on: 07 Jan 2021 14:25

Hello everyone,

The Width parameter for the TelerikTextArea for Blazor will be part of our 2.21.0 release, which will be live hopefully by the end of this month. 

Peter, as an attached file of this post you can see a project which uses a TelerikTextArea set up with the Label and AutoSize = true and I have set the width of the component to 600px. Could you give this project a try and see if any differences cause the issue?

Regards,
Svetoslav Dimitrov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Attached Files:
Peter
Posted on: 04 Jan 2021 09:50
Actually this seems to make no difference, the width setting on class name for the text area doesn't work at all in my experience, the only thing that works is setting the label width.
Peter
Posted on: 04 Jan 2021 09:41
Ok, but with AutoSize="true" the css trick doesn't work, it just ignores the css width. So basically if we want autosizing height, we have to give up width control and vice versa.

This just isn't a great component and seems half-baked.
ADMIN
Svetoslav Dimitrov
Posted on: 04 Jan 2021 08:00

Hello Peter,

We plan to make some changes to the TextArea both internally as a team and as a whole web components division. That is why I am not able to provide any estimations on when this process will be completed. 

I agree that having a Width parameter would make the setup of the component easier. That being said, using CSS to style HTML elements is not considered a bad practice. When you run our components they are rendered as HTML in the browser. We encourage people to use CSS in order to customize the appearance of our components to suit their business needs.

Once the Width parameter is exposed the CSS provided below will be obsolete. One option is to delete the CSS class you have cascaded the rules from, another would be to delete the rules altogether. You could also let the width of the component be controlled by CSS and not the Width parameter.

Regards,
Svetoslav Dimitrov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Peter
Posted on: 03 Jan 2021 22:30
Why was this even released without the ability to set the width easily? I'm expected to release professional looking software, but it makes it difficult when we have to use hacks (that will no doubt have to be removed later) to get the desired result. This is still labelled as 'unplanned' so do we have any idea when these "planned stylistic changes to the component" will be available?
ADMIN
Svetoslav Dimitrov
Posted on: 09 Dec 2020 12:25

Hello Jaroslav,

I have prepared an example that uses a conditional Class parameter to determine if there is a label and if so append a different class. 

Code snippet:

<TelerikButton OnClick="@(_ => LabelText = "My New Label")">Append a Label</TelerikButton> @*Click on this button to place a label for the component*@

<style>
    .myTextArea.k-input,
    .k-textarea {
        width: 400px
    }

    .k-floating-label-container, .text-area-labeled-width {
        width: 600px;
    }
</style>

<TelerikTextArea @bind-Value="@TextAreaValue" Label="@LabelText" Class="@(String.IsNullOrEmpty(LabelText) ? "myTextArea" : "text-area-labeled-width")"></TelerikTextArea>


@code {
    public string TextAreaValue { get; set; } = String.Empty;
    public string LabelText { get; set; } = String.Empty;
}

Regards,
Svetoslav Dimitrov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Jaroslav
Posted on: 08 Dec 2020 12:16

Hello Svetoslav,

your solution doesn't work with Label attributee in the element TelerikTextArea. The width attribute in TelerikTextArea is more comfortable.

Best wishes Jaroslav

WORKING

<TelerikTextArea @bind-Value="@SelectedJudikatura.PravniVetaShrnuti" AutoSize="true"
                                                     Class="myTextArea" Id="PravniVetaShrnuti" />

NOT WORKING

<TelerikTextArea @bind-Value="@SelectedJudikatura.PravniVetaShrnuti" AutoSize="true"
                                                     Label="Právní věta shrnutí" Class="myTextArea" Id="PravniVetaShrnuti" />
ADMIN
Svetoslav Dimitrov
Posted on: 26 Oct 2020 10:34

Hello René,

Currently, we did not expose the Width parameter, because there are planned stylistic changes to the component. For now, we suggest such changes be done by CSS, below I have made a quick example of how this could be achieved.

Code snippet:

<style>
    .myTextArea.k-input,
    .k-textarea {
        width: 140px
    }
</style>

<TelerikTextArea @bind-Value="@TextAreaValue" Class="myTextArea"></TelerikTextArea>


@code {
    public string TextAreaValue { get; set; } = String.Empty;
}

 

Regards,
Svetoslav Dimitrov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.