chore(textarea): document readonly (#588)
This commit is contained in:
parent
7f25a04fc8
commit
c8a4c89936
1 changed files with 17 additions and 0 deletions
|
|
@ -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.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue