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

Add action to the ACF append event #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

treestones
Copy link

When appending fields with ACF the select box is not loaded properly. To fix this issue I propose to add an event listener for the ACF append event. When this event is fired it first removes the existing select box wrapper in the new element and then initialize the select2 plugin for all select boxes.

When appending fields with ACF the select box is not loaded properly. To fix this issue I propose to add an event listener for the ACF append event. When this event is fired it first removes the existing select box wrapper in the new element and then initialize the select2 plugin for all select boxes.
Copy link

@sulym-roman sulym-roman left a comment

Choose a reason for hiding this comment

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

It would be correctly to do

$el.find('.cf7-select').next('.select2').remove();

because we don't want to remove all select2 inside the Repeater field.

@Paul-Hebert
Copy link

Hey @taylormsj, thanks for the great plugin!

What's the status of this PR? I'd be happy to help out if you'd like any changes to this PR. It would be great if we could get this fixed :)

As is, my client needs to add a CF7 field, save, reload the page, and then select their form before saving again.

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.

3 participants