Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
import { RefObject, TextareaHTMLAttributes } from "preact";
interface FormTextAreaProps extends Omit<TextareaHTMLAttributes, "onBlur" | "onChange"> {
id?: string;
currentValue: string;
onChange?(newValue: string): void;
onBlur?(newValue: string): void;
inputRef?: RefObject<HTMLTextAreaElement | null>
}
export default function FormTextArea({ inputRef, id, onBlur, onChange, currentValue, className, ...restProps }: FormTextAreaProps) {
return (
<textarea
ref={inputRef}
id={id}
className={`form-control ${className ?? ""}`}
value={currentValue}
onChange={(e) => {
onChange?.(e.currentTarget.value);
}}
onBlur={(e) => {
onBlur?.(e.currentTarget.value);
}}
style={{ width: "100%" }}
{...restProps}
/>
)
}