I have an accordion, when you click on it the content drops, all works well, but the problem is, i have a delete and an add button, i want to click them and not trigger the accordion. How can i accomplish that? I use UncontrolledCollapse from reactstrap and it has a toggler which is an id of an element.
<ul>
<li id={`toggle-catalog-item-${item.id}`}
>
<a>
Some Accordion
</a>
<div className="icons">
<div>+</div>
<div><TrashIcon /></div>
</div>
</li>
<UncontrolledCollapse
className="children"
toggler={`#toggle-catalog-item-${item.id}`}
>
{menuItemChildren}
</UncontrolledCollapse>
</ul>
All of this grayish background is my <li></li>
that has an id toggler that will toggle the UncontrolledCollapse that will show all the nested items.
I can achieve it by making only the <a></a>
to have a toggle id, the problem is, i want to click on spaces between the icons and have the content drop.
So what i want is to only have icons act as a non-toggler
I tried doing it by applying z-index:100
to icons div
but it doesnt work.
Got my answer! just move toggler from the
li
tag to a div and giveposition:absolute
to iconsI changed it from this to
to this