Skip to content

Instantly share code, notes, and snippets.

@travist
Last active February 10, 2021 23:34
Show Gist options
  • Select an option

  • Save travist/146661128bab4bc2ccba68869f30533a to your computer and use it in GitHub Desktop.

Select an option

Save travist/146661128bab4bc2ccba68869f30533a to your computer and use it in GitHub Desktop.
Extending Form.io Core Components
import {TextFieldComponent} from 'formiojs/build/components/textfield/TextField';
import Components from 'formiojs/build/components/index';
export class ExtendedTextField extends TextFieldComponent {
constructor(component, options, data) {
super(component, options, data);
}
createInput(container) {
let input = super.createInput(container);
if (this.component.custom.listen) {
input.addEventListener('change', () => {
});
}
return input;
}
}
// Override the core component to render this instead.
Components.textfield = ExtendedTextField;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment