Public function

Signature
function useEditableText(
  id: TLShapeId,
  type: string,
  text: string
): {
  rInput: React.RefObject<HTMLTextAreaElement>
  isEditing: boolean
  handleFocus: () => void
  handleBlur: () => void
  handleKeyDown: (e: React.KeyboardEvent<HTMLTextAreaElement>) => void
  handleChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => void
  handleInputPointerDown: (e: React.PointerEvent) => void
  handleDoubleClick: (e: any) => any
  isEmpty: boolean
}
Parameters
NameDescription

id

TLShapeId

type

string

text

string
Returns
{
  rInput: React.RefObject<HTMLTextAreaElement>
  isEditing: boolean
  handleFocus: () => void
  handleBlur: () => void
  handleKeyDown: (e: React.KeyboardEvent<HTMLTextAreaElement>) => void
  handleChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => void
  handleInputPointerDown: (e: React.PointerEvent) => void
  handleDoubleClick: (e: any) => any
  isEmpty: boolean
}
References

TLShapeId

Source

packages/tldraw/src/lib/shapes/shared/useEditableText.ts

useDialogsuseExportAs