I don’t think this is something that I’d use. I don’t generally subscribe to creating absolute limits and go by this rule https://en.wikipedia.org/wiki/Zero_one_infinity_rule. For example, what if on a medium size device you want to have rows of 2 instead of 3, before stacking them all on really small devices. I think that the developer would consider something like this an “edge case”.
You could detect when a row is appended, count the current rows and then add enough to make it a number that is a multiple of the number you want. You could also probably detect when one is deleted, add a confirmation and then remove that number of rows. The problem here would be, which of the others to you delete. Your client might be pissed if you arbitrarily delete the ones they want to keep.
A better (and probably simpler) solution might be to create an acf/validate_value filter https://www.advancedcustomfields.com/resources/acf-validate_value/ for the repeater field and count the number of rows submitted and return an error if it does not match what is needed.
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!
© 2022 Advanced Custom Fields.