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?
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
I cannot share the OML. But I have added the JS in OnReady event:
It is throwing error as '$ not defined'
Use below Javascript -
document.querySelector('#ButtonId').addEventListener('click', function(event) {
event.stopPropagation();
Now button's Onclick action is not executed if I implement this JS
@Shubham Doshi can you please provide me demo oml file so that I will check and do the changes.