Closed tsjohns9 closed 5 years ago
MDBIcon doesn't have prop innerRef. You have to wrap it in the f.e. span and use domElement like this:
<MDBPopover popover clickable placement="left" domElement>
<span><MDBIcon far icon="trash-alt" className="text-danger pointer" /></span>
<div>
<MDBPopoverHeader className="text-center text-primary">Are You Sure?</MDBPopoverHeader>
<MDBPopoverBody className="text-center">
<span
name={product.name}
className="text-danger text-center pointer"
onClick={deleteProduct}
data-cartproductid={product.CartProductId}
data-index={i}
>
Yes
</span>
</MDBPopoverBody>
</div>
</MDBPopover>
Best, Jakub
I am using the
MDBPopover
component and I want to be able to use theMDBIcon
component as the clickable component to trigger the popover. Unfortunately usingMDBIcon
does not work withMDBPopover
.When I use this component without the
domElement
prop clicking the icon will do nothingAnd I am given this error:
When I add the
domElement
prop I receive this error, and my popover is placed in the top left of the nearest absolute ancestor:When I switch the
MDBIcon
component to a simple div with thedomElement
prop it works as expected. When I switch toMDBBtn
without thedomElement
prop it works as expected.EDIT: This is also impacting the
MDBDropdownItem
component as well and the same issue happens whenMDBTooltip
is used instead ofMDBPopover
.