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

Autoclose scrolls back to the top of page

Open studio7web opened this issue 7 years ago • 3 comments

jquery-confirm version: v3.x.x

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

Current behavior: I have an autoclose confirm with to delete something and when the time ends it scrolls back to the top of the page.

Expected behavior: the confirm dialog would autoclose and stay where it currently is on the page not scrolling to top

Steps to reproduce:

Related code:

$("#mnuDeleteTask").click(function() {
	
			$.confirm({
			theme: 'material',
			title: 'Delete Selected Task?',
			content: 'Do you really wish to delete the selected task? Once you click \'Yes\' you cannot undo this action.',
			type: 'red',
			typeAnimated: true,
			autoClose: 'close|10000',
			buttons: {
				DeleteTask: {
					text: 'Delete Task',
					btnClass: 'btn-red',
					action: function(){
					}
				},
				close: function () {
				}
			}
		    });
	
	
});

this is all i used to get the dialog to display as an autoclose.

Other information:

studio7web avatar Oct 14 '18 11:10 studio7web

I added an alert to say that the action was cancelled on Close and it also scrolls to the top of the page when i click Ok... this is strange.

studio7web avatar Oct 14 '18 11:10 studio7web

in the JS file i have set scrollToPreviousElement: false,

scrollToPreviousElementAnimate: false, and it is NOT scrolling to the top anymore.

studio7web avatar Oct 14 '18 12:10 studio7web

in the JS file i have set scrollToPreviousElement: false,

scrollToPreviousElementAnimate: false, and it is NOT scrolling to the top anymore.

I have set that but still scrolls top on any button click and it even breaks the behavior. how to fix?

FurkanGozukara avatar May 14 '20 21:05 FurkanGozukara