Home Forums Backend Issues (wp-admin) [repeater] Conditional Logic breaks inside a repeater


[repeater] Conditional Logic breaks inside a repeater

  • Hi,

    I’ve created a repeater field, with three basic fields inside: a radio selection, an image and a text field. I’ve setup a simple condinal logic between the first inner field, and the following two. Based on the first field selection, field n.2 is hidden and field n.3 is shown, and viceversa.

    In practice, field one choose if should be shown field number two or field number three. field n.2 and field n.3 should never be visible toghether.

    When we are inside a repeater, this conditional logic does not work.
    When I switch choice within field one, it seems like a <thead> or <th> won’t hide correctly.

    This bug happens only when we are inside a repeater.

    I’ve attached a screenshot below, just to help.

    Acf Version is with latest wordpress version.

  • Yes and no. If you add another row with the first being set to image and the second being set to text then both columns will need to be shown. This is something that has to do with displaying the repeater as a table. If you show the repeater as a block or a row this will not happen.

  • Hi John,
    Thanks for the reply, what you say is correct.

    This could not be considered an issue, due to the html intrinsic behaviour of a table element.

    However I tried to find a solution to this possible scenario and I think that a solution could be nesting two repeaters, as shown in the screenshot below.
    The First repeater is used to creates rows, the second repeater is used to show all fields arranged in a row. This way any conditional logic will affect only its row.

    Hope this could be useful for someone.
    Thanks again.

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘[repeater] Conditional Logic breaks inside a repeater’ is closed to new replies.