Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scroll to top issue #555

Open
jiunder opened this issue Mar 11, 2022 · 1 comment
Open

scroll to top issue #555

jiunder opened this issue Mar 11, 2022 · 1 comment

Comments

@jiunder
Copy link

jiunder commented Mar 11, 2022

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:**
 
@mzbk
Copy link

mzbk commented Apr 8, 2022

Add below lines.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants