Karthi
Karthi

Reputation: 3489

antd dropdown is not closing on mouse leave

Using antd for adding an dropdown menu.Its not closing on mouse leave and click of an item inside dropdown.it remains open in the same place when page is scrolled.

<Dropdown  className="buy-dropdown" overlay={menu} placement="topLeft" trigger={["click"]   >       
   <Button className="cxe-buy-game-btn" >
      <img src="/static/images/cart-buy.svg" /> Buy
   </Button>
</Dropdown>

Upvotes: 0

Views: 1562

Answers (1)

Zohaib Ijaz
Zohaib Ijaz

Reputation: 22875

It's because you have mentioned click as trigger. remove this prop so default will be hover or add hover

<Dropdown  className="buy-dropdown" overlay={menu} placement="topLeft" trigger={["hover"]   >       
   <Button className="cxe-buy-game-btn" >
      <img src="/static/images/cart-buy.svg" /> Buy
   </Button>
</Dropdown>

Upvotes: 2

Related Questions