useEditableText

See source code
function useEditableText(
  shapeId: TLShapeId,
  type: string,
  text: string
): {
  handleBlur: () => void
  handleChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => void
  handleDoubleClick: (e: any) => any
  handleFocus: () => void
  handleInputPointerDown: (e: React.PointerEvent) => void
  handleKeyDown: (e: React.KeyboardEvent<HTMLTextAreaElement>) => void
  isEditing: boolean
  isEditingAnything: boolean
  isEmpty: boolean
  rInput: React.RefObject<HTMLTextAreaElement>
}

Parameters

NameDescription

shapeId

type

string

text

string

Returns

{
  handleBlur: () => void
  handleChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => void
  handleDoubleClick: (e: any) => any
  handleFocus: () => void
  handleInputPointerDown: (e: React.PointerEvent) => void
  handleKeyDown: (e: React.KeyboardEvent<HTMLTextAreaElement>) => void
  isEditing: boolean
  isEditingAnything: boolean
  isEmpty: boolean
  rInput: React.RefObject<HTMLTextAreaElement>
}
Prev
useDialogs
Next
useExportAs