35
Views
5
Comments
OnClick action of buttons not executing if popover widget is expanded
Application Type
Reactive

I have a popover widget on the screen. When it is expanded and clicked any button outside of popover, it just collapses the popover menu and OnClick action of button does not execute. When the popover is closed action is executed.

Can anyone help me how to overcome this, how to execute OnClick action of button outside of popover when Popover is expanded?

2024-12-02 13-16-47
Vipin Yadav

Hi @Shubham Doshi,

Could you please share your OML file or a demo file so that I can review it and get back to you? 

You can use the following JavaScript on your screen : 

$(document).on('click', '.test-button', function(event) {

    event.stopPropagation(); // Prevent the Popover from collapsing

});

Replace .test-button with the class or ID of the button 

Thanks,

Vipin Yadav

2022-12-09 04-50-17
Shubham Doshi

I cannot share the OML. But I have added the JS in OnReady event:

It is throwing error as '$ not defined'

2024-12-02 13-16-47
Vipin Yadav


Use below Javascript -

document.querySelector('#ButtonId').addEventListener('click', function(event) {  

  event.stopPropagation(); 

}); 

Thanks,

Vipin Yadav

2022-12-09 04-50-17
Shubham Doshi

Now button's Onclick action is not executed if I implement this JS

2024-12-02 13-16-47
Vipin Yadav

@Shubham Doshi can you please provide me demo oml file so that I will check and do the changes.

Thanks,

Vipin Yadav 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.