Created
January 27, 2018 22:29
-
-
Save beattyml1/c8b9499d951f8a2f73292f6374d85c1a to your computer and use it in GitHub Desktop.
Metatonic Custom Editor Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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