Skip to content

Instantly share code, notes, and snippets.

@beattyml1
Created January 27, 2018 22:29
Show Gist options
  • Save beattyml1/c8b9499d951f8a2f73292f6374d85c1a to your computer and use it in GitHub Desktop.
Save beattyml1/c8b9499d951f8a2f73292f6374d85c1a to your computer and use it in GitHub Desktop.
Metatonic Custom Editor Example
@editorFor("numeric", InputBoxLabelContainer, { isDefault: true })
export class NumericEditor extends BaseEditor<Numeric, NumericTypeInfo, BaseEditorModel<Numeric>, void> {
render() {
return (
<input type="number"
id={this.uniqueId()}
value={this.value().toEditorString()}
required={this.field().required}
max={this.props.field.max || undefined}
min={this.props.field.min || undefined}
step={1}
onChange={this.notifyChanged}
/>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment