Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overhaul custom control setup #1454

Merged
merged 1 commit into from
Oct 19, 2023

Conversation

lucasnetau
Copy link
Collaborator

Custom controls we loaded globally via static methods and properties in custom.js, each formBuilder instance would remove the old definitions before adding their own in. This meant that field definitions would appear in the controls in earlier formBuilders however would throw an error when clicked because the definition has been removed

This PR reworks the custom controls by introducing a per instance container to register and retrieve custom control registrations. A proxy class is used to map template to the controlCustom class.

Closes #1090

…se it per formBuilder instance. This ensures definitions set in one formBuilder do not interact with definitions in other formBuilder instances
Copy link
Owner

@kevinchappell kevinchappell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome stuff. thanks for fixing this ancient bug

type: 'checkbox-group',
subtype: 'custom-group',
label: 'Custom Checkbox Group w/Sub Type',
required: !0,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just curious, why not just true?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't answer that. I'm not sure if it was my IDE that did that or if I copy/pasted the example from somewhere. I know webpack has a habit of using !0 for true

@kevinchappell kevinchappell merged commit 60c8cf9 into kevinchappell:master Oct 19, 2023
1 check passed
@github-actions
Copy link

🎉 This PR is included in version 3.16.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't add custom element in multiple form builder!
2 participants