Resizing in TextBox multiline

Is there a parameter to enable or disable the Rezsizing in TextBox? or changing it by a condition ?

1 Reply 1 reply marked as answer

SN Sevvandhi Nagulan Syncfusion Team February 1, 2021 07:56 AM UTC

Hi Adriana, 


Greetings from Syncfusion support. 


We checked your query. You can disable the resize of the multiline textbox by applying the following CSS styles. Also, we can dynamically disable and enable the resizing of multiline textbox by changing the CssClass property dynamically. Refer the below code, 


SfTextBox Multiline="true" CssClass="@cssClass"></SfTextBox> 
 
 
<button @onclick="disable">Disable Resize</button> 
<button @onclick="enable">Enable Resize</button> 
 
 
 
<style> 
    .enable textarea.e-input, .enable.e-input-group textarea, .enable.e-input-group textarea.e-input, .enable.e-input-group.e-control-wrapper textarea, .enable.e-input-group.e-control-wrapper textarea.e-input { 
        resize: vertical; 
    } 
    .disable textarea.e-input, .disable.e-input-group textarea, .disable.e-input-group textarea.e-input, .disable.e-input-group.e-control-wrapper textarea, .disable.e-input-group.e-control-wrapper textarea.e-input { 
        resize: none; 
    } 
</style> 
 
 
@code { 
 
    public string cssClass { get; set; } 
    public void disable() 
    { 
        cssClass = "disable"; 
    } 
    public void enable() 
    { 
        cssClass = "enable"; 
    } 
} 



If you are using the FloatLabelType property for float input, then please use the below code for resizing the multiline textbox component. 



  textarea.e-input, 
    .e-float-input textarea, 
    .e-float-input.e-control-wrapper textarea, 
    .e-input-group textarea, 
    .e-input-group.e-control-wrapper textarea { 
        resize: none; 
    } 


Please find the sample below. 




Please check the above sample and get back to us if you need further assistance. 


Regards, 
Sevvandhi N  


Marked as answer
Loader.
Up arrow icon