jquery-confirm icon indicating copy to clipboard operation
jquery-confirm copied to clipboard

scroll to top issue

Open jiunder opened this issue 3 years ago • 1 comments

jquery-confirm version: v3.3.4

I'm submitting a ... (check one with "x") [X] bug report [ ] feature request [ ] support request

Current behavior: When user scroll down the web page and after clicking a cancel button or any button of the confirm dialog , the web page will be scrolled to top .

Expected behavior: Web page position without any change after click buttons of confirm dialog.

Steps to reproduce:

Related code:

$.confirm({
    title: 'delete item',
    content:'are you sure?!!',
    type: 'orange',
    icon: 'fas fa-exclamation-triangle',
    typeAnimated: true,
    buttons: {
        btnOk: {
            text: 'Yes',
            btnClass: 'btn-blue',
            action: function(){
         	$.ajax({
         	              url: httpDispatcher + 'controller url.....',
	     	              data:{
	    			    	    ajax params......
	                      },
 	                      type:"POST",
  	                      dataType:'json',
	                      success: function(result){    
	    	                           if(result.message!=null && result!='')
	    	                           {
	                               	       $.alert({
	      	                                          title: 'delete item',        
  		                                          icon : 'fas fa-check' ,
    		                                          content:result.message,
    		                                          type : 'blue'
	                                       });      
	     	                           }
      	                      },                            
     	                     error:function(XMLHttpRequest, textStatus, errorThrown) {	                        	
    	                           jsApp.ajaxMsg(XMLHttpRequest, textStatus, errorThrown);
    	                     }
             }); //end of ajax
         }//end of action:function
      },//end of btnOk
     close: {
           text: 'cancel',
           action:function () {
	        return;
	   }
     }
   }//end of buttons
});


**Other information:**
 

jiunder avatar Mar 11 '22 06:03 jiunder

Add below lines.

scrollToPreviousElement: false, // add this line scrollToPreviousElementAnimate: false, // add this line

mzbk avatar Apr 08 '22 06:04 mzbk