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

Automatic form mounting #9

Merged
merged 25 commits into from
Jul 4, 2024
Merged

Automatic form mounting #9

merged 25 commits into from
Jul 4, 2024

Conversation

rockwellll
Copy link
Collaborator

This PR changes the default behavior for mounting forms.

Before

Form mounting was always manual, developers had to mount forms.

After

FormCollection automatically mounts forms into the page. Additionally, this feature can be disabled by passing a new configuration option autoMountForms to the initializer.

Hellotext.initialize('HELLOTEXT_BUSINESS_ID', { autoMountForms: false })

It discards the load event and instead uses the MutationObserver API to listen when forms are connected to the DOM, it ensures duplicate/already-loaded forms are not loaded again if a new form has been appended.

@rockwellll rockwellll merged commit a88a34f into main Jul 4, 2024
2 checks passed
@rockwellll rockwellll deleted the automatic-form-mounting branch July 6, 2024 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant