Last active
February 10, 2021 23:34
-
-
Save travist/146661128bab4bc2ccba68869f30533a to your computer and use it in GitHub Desktop.
Extending Form.io Core Components
This file contains hidden or 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
| 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