'showPopup' method is working wrong

Hi Syncfusion Team,
I'm using the DropdownList component and want to use a Button to show the popup of the DropdownList component. (When I click the button, the popup is opened). I am using showPopup property to implement. It's working well when I click the button slowly. But when I click quickly and many times in a short time, the popup doesn't show.

Link sample:https://stackblitz.com/edit/react-cdsqbq?file=index.js

How I can fix it.​

Thanks.


3 Replies

UD UdhayaKumar Duraisamy Syncfusion Team July 19, 2022 02:52 PM UTC

Hi Ton,


We suspect that you are trying to open the popup even though the popup is in the opened state. So, we suggest you call the ShowPopup method when the popup is not opened as in the below code snippet.


function onClickButton() {

    if (!ref.current.isPopupOpen) {

      ref.current.showPopup();

    } else {

      ref.current.hidePopup();

    }

  }

 


Sample : https://stackblitz.com/edit/react-cdsqbq-c9amcw?file=index.js,index.html


Kindly try the above sample and let us know if this meets your requirement.


Regards,

Udhaya Kumar D



TT Ton That Hung July 22, 2022 03:00 PM UTC

That's great. Thanks for your support.



BS Buvana Sathasivam Syncfusion Team July 25, 2022 06:06 PM UTC

Most welcome. Please let us know if you need any further assistance.


Loader.
Up arrow icon