@mocanvas/mocanvas · interface
interface TLUiInputPropsThe text field the chrome uses: a page name, a link, a numeric style value.
Uncontrolled in the React sense — it keeps its own draft and reports it —
because the values it edits are committed to the document, and committing
every keystroke would fill the undo stack with one entry per letter. The
three callbacks are the seam for that: onValueChange while typing,
onComplete on Enter or blur, onCancel on Escape.
Properties · 17
autoFocus?: booleanautoSelect?: booleanSelect the whole value when it takes focus.
className?: stringdefaultValue?: stringdisabled?: booleanicon?: stringid?: stringlabel?: stringonBlur?(): voidonCancel?(value: string): voidEscape: put the original value back.
onComplete?(value: string): voidEnter, or losing focus: the value is final.
onFocus?(): voidonValueChange?(value: string): voidplaceholder?: stringref?: Ref<HTMLInputElement>style?: CSSPropertiesvalue?: stringThe value to start from. Changing it replaces the draft.
mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.