N
Nuxt7d ago
Olamide

Textarea `rows` prop on render

I'm setting the Textarea rows to 1:
<UTextarea :rows="1" />
<UTextarea :rows="1" />
However, it automatically sets to 2 or 4 when it renders.
2 Replies
kapa.ai
kapa.ai7d ago
Hi @Olamide. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- I understand you're having an issue with the rows prop in the UTextarea component from Nuxt UI. According to the documentation, the rows prop should control the number of visible text lines in the textarea, with a default value of 3. Looking at the documentation for the UTextarea component, it clearly states that you can use the rows prop to set the number of rows:
<template>
<UTextarea :rows="12" />
</template>
<template>
<UTextarea :rows="12" />
</template>
Textarea documentation shows that this prop should work as expected. However, you're experiencing an issue where setting :rows="1" results in the textarea rendering with 2 or 4 rows instead. This behavior isn't documented in the knowledge sources provided. There could be a few potential causes: 1. There might be CSS styles affecting the height calculation 2. The autoresize feature might be interfering (if enabled) 3. There could be a minimum height constraint in the component If you're using the autoresize feature, try disabling it:
<UTextarea :rows="1" :autoresize="false" />
<UTextarea :rows="1" :autoresize="false" />
If the issue persists, you might want to check if there are any CSS styles affecting the component or if there's a minimum height constraint in the Nuxt UI implementation. Unfortunately, the knowledge sources don't provide more specific information about this particular issue. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai7d ago
<@957789387213656114> Kapa.ai is still learning and improving, please let me know how I did by reacting below.

Did you find this page helpful?