import { KbqTextareaModule } from '@koobiq/components/textarea';

KbqTextarea

directiveCopy link to KbqTextarea
@Directive({ selector: 'textarea[kbqTextarea]', exportAs: 'kbqTextarea' })
class KbqTextarea implements KbqFormFieldControl<any>, CanUpdateErrorState {
    readonly canGrow = input<boolean>(true);
    readonly maxRows = input<number | undefined>();
    readonly errorStateMatcher = input<ErrorStateMatcher>();
    readonly readonly = input<boolean>(false);
    readonly freeRowsHeight = input<number | undefined>();
    readonly ngControl: NgControl | null;
    readonly parentForm: NgForm | null;
    readonly parentFormGroup: FormGroupDirective | null;
    readonly defaultErrorStateMatcher: ErrorStateMatcher;
    readonly errorState: Signal<boolean>;
    readonly maxRowLimitReached: Signal<boolean>;
    updateErrorState(): void;
    focus(): void;
}
canGrowinputCopy link to canGrowboolean

Parameter enables or disables the ability to automatically increase the height. If set to false, the textarea becomes vertically resizable.

maxRowsinputCopy link to maxRowsnumber | undefined

Maximum number of lines to which the textarea will grow. Unlimited when unset.

errorStateMatcherinputCopy link to errorStateMatcherErrorStateMatcher

An object used to control when error messages are shown.

readonlyinputCopy link to readonlyboolean

Whether the textarea is read-only: its value can be selected and copied, but not changed. A read-only textarea shows no placeholder. Defaults to false.

freeRowsHeightinputCopy link to freeRowsHeightnumber | undefined

Distance from the last line to the bottom border. Defaults to a single line height.

errorStateCopy link to errorStateSignal<boolean>

Whether the component is in an error state.

maxRowLimitReachedCopy link to maxRowLimitReachedSignal<boolean>

Flag that will be set to true when the maximum number of lines is reached. Maximum number of rows can be set using the maxRows input.

focus()Copy link to focus()void

Focuses the textarea.

KBQ_TEXTAREA_VALUE_ACCESSOR

constCopy link to KBQ_TEXTAREA_VALUE_ACCESSOR
const KBQ_TEXTAREA_VALUE_ACCESSOR: InjectionToken<{ value: any }>;
Suggestions for improvement
If you found a mistake or want to improve the article, create an issue on GitHub.