bootstrap-blocks-wordpress-plugin icon indicating copy to clipboard operation
bootstrap-blocks-wordpress-plugin copied to clipboard

Add bootstrap accordion blocks

Open Sishasong opened this issue 4 years ago • 5 comments
trafficstars

Hi, I recently need to add a bootstrap accordion as block for gutenberg. I use your plugins to develop those block (accordion & accordion-item). It was the first time i develop a gutenberg block, i don't really how react works, i tried to follow your block structure and logic.

I hope you will accept my pull request or you will tell me what i should improve to accept this. May be i should have to add some unit test (i need to understand how those tests works first :p). Any tips are welcome. Sorry for my english...

Sishasong avatar Oct 14 '21 12:10 Sishasong

Hi @Sishasong. Thanks a lot for the PR! Sorry that I didn't answer till now, was pretty busy the last few weeks. I will have a look at it as soon as possible.

tschortsch avatar Oct 23 '21 07:10 tschortsch

The accordion block solution by @Celian-Nematis works great (thanks!), however there is one issue with the "Always open" functionality: When you change or add text to the accordion items, the parent accordion id changes and therefore the other tabs do not close simultaneously, they stay open. Do you have any idea how to fix it?

amuhr-design avatar Jun 13 '22 12:06 amuhr-design

The accordion block solution by @Celian-Nematis works great (thanks!), however there is one issue with the "Always open" functionality: When you change or add text to the accordion items, the parent accordion id changes and therefore the other tabs do not close simultaneously, they stay open. Do you have any idea how to fix it?

Hi @amuhr-design, Sorry for this late answer. First of all, i'm glad you like this feature. I'm not sure to understand what behavior do you except. I've made some test and it's works like bootstrap 5 Accordion works (check here => https://getbootstrap.com/docs/5.0/components/accordion/#always-open)

I'm working on the PR update to be up to date with master branch.

Sishasong avatar Aug 26 '22 11:08 Sishasong

The accordion block solution by @Celian-Nematis works great (thanks!), however there is one issue with the "Always open" functionality: When you change or add text to the accordion items, the parent accordion id changes and therefore the other tabs do not close simultaneously, they stay open. Do you have any idea how to fix it?

Hi again @amuhr-design, i finally found what your issue is. It's not the "Always open" feature issue. parentClientId was not set when adding an accordion-item. It's fixed and the feature is update to date with master branch

Sishasong avatar Aug 30 '22 15:08 Sishasong

Hi @Sishasong, Thanks a lot for your efforts - the fix works like a charm. Problem solved =)

amuhr-design avatar Aug 30 '22 18:08 amuhr-design