You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 16, 2021. It is now read-only.
importclassnamesfrom'classnames'importReactAutosizeTextareafrom'react-autosize-textarea'// override just the renderTextarea partial of the default templatefunctionrenderTextarea(locals){constattrs={
...locals.attrs,className: classnames(locals.attrs.className)}constonChange=(evt)=>locals.onChange(evt.target.value)return<ReactAutosizeTextarearows="3"{...attrs}value={locals.value}onChange={onChange}/>}consttextboxTemplate=t.form.Form.templates.textbox.clone({ renderTextarea })// here we are: the factoryclassAutosizeTextareaFactoryextendst.form.Textbox{getTemplate(){returntextboxTemplate}}// exampleconstType=t.struct({text: t.String})constoptions={fields: {text: {type: 'textarea',factory: AutosizeTextareaFactory}}}
The text was updated successfully, but these errors were encountered:
Another example of a custom factory: an autosize textarea using @buildo's react-autosize-textarea
The text was updated successfully, but these errors were encountered: