useEditablePlainText
function useEditablePlainText(
shapeId: TLShapeId,
type: ExtractShapeByProps<{
text: string;
}>["type"],
text?: string,
): {
handleBlur: () => void;
handleChange: ({ plaintext }: { plaintext: string }) => void;
handleDoubleClick: (
e:
| {
nativeEvent: Event;
}
| Event,
) => void;
handleFocus: () => void;
handleInputPointerDown: (e: React.PointerEvent<Element>) => void;
handleKeyDown: (e: KeyboardEvent) => void;
handlePaste: (
e: ClipboardEvent | React.ClipboardEvent<HTMLTextAreaElement>,
) => void;
isEditing: boolean;
isEmpty: boolean;
isReadyForEditing: boolean;
rInput: React.RefObject<HTMLTextAreaElement | null>;
};Parameters
| Name | Description |
|---|---|
| |
| |
| |
Returns
{
handleBlur: () => void;
handleChange: ({ plaintext }: { plaintext: string }) => void;
handleDoubleClick: (
e:
| {
nativeEvent: Event;
}
| Event,
) => void;
handleFocus: () => void;
handleInputPointerDown: (e: React.PointerEvent<Element>) => void;
handleKeyDown: (e: KeyboardEvent) => void;
handlePaste: (
e: ClipboardEvent | React.ClipboardEvent<HTMLTextAreaElement>,
) => void;
isEditing: boolean;
isEmpty: boolean;
isReadyForEditing: boolean;
rInput: React.RefObject<HTMLTextAreaElement | null>;
};Prev
useDirectionNext
useEditableRichText