chore(textarea): document readonly (#588)

This commit is contained in:
George Serbanescu 2020-02-19 14:14:26 +02:00 committed by Thomas Allmer
parent 7f25a04fc8
commit c8a4c89936

View file

@ -24,6 +24,7 @@ Default rows is 2 and it will grow to max-rows of 6.
- `max-rows` attribute to set the amount of rows it should resize to, before it will scroll - `max-rows` attribute to set the amount of rows it should resize to, before it will scroll
- `rows` attribute to set the minimum amount of rows - `rows` attribute to set the minimum amount of rows
- `readonly` attribute to prevent changing the content
## How to use ## How to use
@ -66,6 +67,22 @@ The textarea can be disabled with the `disabled` attribute.
</Story> </Story>
</Preview> </Preview>
### Readonly
`readonly` attribute indicate that you can't change the content. Compared with `disabled` attribute, the `readonly` attribute doesn't prevent clicking or selecting the element.
<Preview>
<Story name="Readonly">
{html`
<lion-textarea
label="Readonly"
readonly
.modelValue=${['batman', 'and', 'robin'].join('\n')}
></lion-textarea>
`}
</Story>
</Preview>
### Stop growing ### Stop growing
Use the `max-rows` attribute to make it stop growing after a certain amount of lines. Use the `max-rows` attribute to make it stop growing after a certain amount of lines.