flyntwp / acf-hide-layout

Easily hide the layout of the flexible content on the frontend but still keep it in the backend.
19 stars 5 forks source link

Hide / Show Layout Button is displayed multiple times #1

Closed timohubois closed 1 year ago

timohubois commented 3 years ago

If flexible_content inside flexible_content is used then the "Hide / Show Layout Button" displayed multiple times.

flexible_conten_inside_ flexible_conten
mjot commented 3 years ago

I can confirm this issue:

CleanShot 2021-07-01 at 20 32 54@2x

mjot commented 3 years ago

If you click on one of the hide / show buttons, all layouts are hidden:

CleanShot 2021-07-01 at 20 44 31@2x

mjot commented 2 years ago

@harunbleech This problem is still persist.

viktorbijlenga commented 2 years ago

This issue also affects repeater fields.

R3dRidl3 commented 2 years ago

@harunbleech Ah flex inside flex. Yeah I can confirm that too. Must be something easy, I will take a look too.

image

viktorbijlenga commented 2 years ago

The data-index value of the acf-hide-layout icon seems a bit of. I’m not sure if it's relevant, but might be something to look into.

20211214-haMKXR5k@2x
R3dRidl3 commented 2 years ago

I don't think it has anything to do with that. It has to do with the JS that's adding the items.

I have reduced it by 1, so still 2 visible instead of 3 now. In script.js change $controls = $el.find( '.acf-fc-layout-controls' ), to $controls = $el.find( '> .acf-fc-layout-controls' ),

timohubois commented 1 year ago

Fixed with the latest release. Thanks to @harunbleech 💪