Skip to main content

Textarea

scoped

Textarea rozširuje možnosti štandardného HTML textarea elementu. Pridáva štýly pre dosiahnutie vizuálne konzistentného používateľského rozhrania a ponúka funkcie ako napríklad auto-height - prispôsobenie výšky elementu vloženému textu, alebo tiež počítadlo vložených znakov.

Základné použitie

Standard

Pridaním atribútu standard sa zobrazí textarea v štýle štandardného HTML textarea elementu.

Counter

Pridaním atribútu counter sa pod textareou zobrazí počítadlo zobrazujúce počet vložených znakov a ich maximálny povolený počet. Je potrebné použitie v kombinácii s vlastnosťou max-length. V opačnom prípade bude maximálny povolený počet nastavený na 1000.

Resize (none)

Vlastnosť resize určuje správanie zmeny veľkosti elementu. Ak je nastavená na hodnotu none, veľkosť poľa zostane fixná.

Resize (auto)

Ak je vlastnosť resize nastavená na hodnotu auto, automaticky sa prispôsobí veľkosť elementu vloženému obsahu.

Disabled

Pri vloženom atribúte disabled do elementu textarea nebude možné písať.

Atribúty a Vlastnosti

counter

DescriptionIf true, adds a counter below the element showing the number of characters inserted and also the maximum number allowed.
Attributecounter
Typeboolean
Defaultfalse

disabled

DescriptionIf true, the textarea will not be writable.
Attributedisabled
Typeboolean
Defaultfalse

label

DescriptionDefines the text description for the textarea element.
Attributelabel
Typestring | undefined
Defaultundefined

maxlength

DescriptionSets the maximum number of characters allowed. Used in conjunction with the counter attribute.
Attributemaxlength
Typenumber | undefined
Default1000

name

DescriptionSets the name attribute of the inner textarea of the element. This is important, for example, when used in forms.
Attributename
Typestring
Defaultthis.inputId

resize

DescriptionDefines the behavior of element resizing. If it is set to "auto", the element size is automatically adjusted to the content.
Attributeresize
Type"car"
Defaultundefined

rows

DescriptionDefines the number of visible lines of text in the element.
Attributerows
Typenumber | undefined
Defaultundefined

spellcheck

DescriptionIf true, spell checking will be activated in textarea.
Attributespellcheck
Typeboolean
Defaultfalse

Option

DescriptionSetting it to "standard" will display a textarea in the style of the standard HTML textarea element.
AttributeOption
Typestring
Default''

Eventy

NameDescription
blurFired when an element loses focus.
wj:textarea:changeIt is invoked after a change in textarea.
focusCalled when the element gets focus.
wj:textarea:inputThe ionInput event is fired each time the user modifies the textarea's value. Unlike the ionChange event, the ionInput event is fired for each alteration to the textarea's value. This typically happens for each keystroke as the user types.

When clearOnEdit is enabled, the ionInput event will be fired when the user clears the textarea by performing a keydown event.

Metódy

No public methods available for this component.

CSS Shadow Parts

NameDescription
inputRefers to the textarea element inside the element.

CSS Custom Vlastnosti

NameDescription
--wj-textarea-background-colorSets the background color of the element.
--wj-textarea-border-colorSets the color of the edges of the element.
--wj-textarea-border-color-focusSets the color of the edges when you take a photo.
--wj-textarea-border-radiusAdjusts the rounding of the element edges.
--wj-textarea-border-styleSets the element's border style.
--wj-textarea-border-widthSets the width of the element edges.
--wj-textarea-colorSets the text color of the element.
--wj-textarea-color-invalidSets the text color on error.
--wj-textarea-font-familySets the font of the element.
--wj-textarea-line-heightSets the height of the element row.
--wj-textarea-margin-bottomSets the lower outer offset of the element.
--wj-textarea-paddingSets the internal offset of the element.

Sloty

No slots available for this component.