Home › Forums › Bug Reports › Repeater + conditional logic losing content when adding/rearranging rows › Reply To: Repeater + conditional logic losing content when adding/rearranging rows
Hi @soojooko
Thanks for the reply.
The flexible content field layouts should remain closed on page load, if they are staying open, perhaps there is a bug I am not aware of. Are you using ACF PRO, or ACF4 + add-on?
It sounds like you will require some sort of conditional logic without disabling the inputs.
You may be able to make use of some JS actions to prevent ACF from disabling the inputs. That way you can continue to use conditional logic without the original issue.
<script type="text/javascript">
(function($) {
acf.add_action('hide_field', function( $field, context ){
// bail early if not conditional logic (may be tab field)
if( context !== 'conditional_logic' ) {
return;
}
// maybe review $field name, key to avoid this on all fields?
// ...
// remove disable
$field.find('.acf-clhi').removeAttr('disabled');
});
})(jQuery);
</script>
Let me know if the above is confusing, basically, once added to the admin page, this will undo the ACF logic which disables inputs via conditional lgoic
Thanks
E
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.