function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
LinThawLinThaw 

How to show 5 rows with lightning:textarea?

Hi,

How to show 5 rows with lightning:textarea?

Thanks in advance.
Regards,
LinThaw.
Best Answer chosen by LinThaw
Raj VakatiRaj Vakati

lightning:textarea component dnt have any row attribute and The rows and cols HTML attributes are not supported. To apply a custom height and width for the text area, use the class attribute. To set the input for the text area, set its value using the value attribute. Setting this value overwrites any initial value that's provided.


Here is the example 
<aura:component >
    
    <lightning:textarea name="notes" value="" class="topText" label="Notes" maxlength="300" />

    
    
</aura:component>
 
.THIS .slds-textarea {
    height:100px !important;
}

 

All Answers

Raj VakatiRaj Vakati

lightning:textarea component dnt have any row attribute and The rows and cols HTML attributes are not supported. To apply a custom height and width for the text area, use the class attribute. To set the input for the text area, set its value using the value attribute. Setting this value overwrites any initial value that's provided.


Here is the example 
<aura:component >
    
    <lightning:textarea name="notes" value="" class="topText" label="Notes" maxlength="300" />

    
    
</aura:component>
 
.THIS .slds-textarea {
    height:100px !important;
}

 
This was selected as the best answer
LinThawLinThaw
Thanks Raj,

It is working.
but we need more css to control manual adjust high of textarea.
after add this css, we can't adjust high manually.
Any idea?

Regards,
LinThaw
Raj VakatiRaj Vakati
That's true .. I can suggest use the tokens 
LinThawLinThaw
Thanks
Ravichandra sindheRavichandra sindhe

Hi raj,

i need a help

i want to display a passage(i keep in rich text area field of the custom object) with a  exact formate in text area only in lightning component...Could you please suggets me how to achieve this