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

Bug with animation

Open atversko opened this issue 6 years ago • 6 comments

jquery-confirm version: All versions, last tested v3.3.3

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

Current behavior: When I call confirm window first time with animation "top" or other animation for example: $.confirm({ theme: "modern", animation: 'top', closeAnimation: 'top' ...});

Animation "top" works correctly first time, but when I click cancel button and then again call prev confirm window, animation is not "top" now, but coming from web page left top (like flying) (i think u dont have even such animation in options).

Cancel button code: cancel: { text: 'Cancel' }

But if I close confirm window by clicking "jconfirm-closeIcon", then I can call confirm window again with correct "top" animation.

Also if page is not scrolled to top, after clicking cancel button animation works correctly.

So, this bug is only when page is scrolled to top and clicking to cancel button, other ways works correctly.

Here is .gif video of bug: https://ufile.io/huer7

Can u fix it? Or should I do something?

atversko avatar Jan 02 '19 08:01 atversko

I have the same issue but in my case, I have not set any custom animation and just using the default. I have backgroundDismiss set to true.

The default animation is used the first time the modal is opened. Clicking outside the modal window closes it, and opening the same window would have the same opening animation, no problem. The problem is when the the same window is closed through custom button and reopened again, the modal window animation is different from the expected default - similar to above post - it comes from the web page's top left corner instead.

Edit: Confirming the above post, the bug seems to only occur when the page is scrolled to the top.

2gourds avatar Mar 08 '19 03:03 2gourds

same for me but it seem that if i set typeAnimated and animateFromElement to false it is fixed

vlad1m1r avatar Jul 10 '19 13:07 vlad1m1r

same for me but it seem that if i set typeAnimated and animateFromElement to false it is fixed

I used vlad1m1r fix and it worked for me.

raffaelecolleo avatar Feb 10 '20 03:02 raffaelecolleo

Thanks @vlad1m1r: Finally paid attention to the documentation once you pointed out animateFromElement ...

image

digitalextremist avatar Jan 30 '21 16:01 digitalextremist

When I try @vlad1m1r suggestion, everything stops working. I get the following error in console:

jquery-confirm.min.js:10 Uncaught TypeError: el.offset is not a function at Jconfirm.setStartingPoint (jquery-confirm.min.js:10) at Jconfirm._buildHTML (jquery-confirm.min.js:10) at Jconfirm.open (jquery-confirm.min.js:10) at jquery-confirm.min.js:10 setStartingPoint @ jquery-confirm.min.js:10 _buildHTML @ jquery-confirm.min.js:10 open @ jquery-confirm.min.js:10 (anonymous) @ jquery-confirm.min.js:10 setTimeout (async) _init @ jquery-confirm.min.js:10 Jconfirm @ jquery-confirm.min.js:10 jconfirm @ jquery-confirm.min.js:10 $.confirm @ jquery-confirm.min.js:10 (anonymous) @ scoreboardScript.js:6 dispatch @ jquery-3.4.1.slim.min.js:2 v.handle @ jquery-3.4.1.slim.min.js:2

Any Suggestions? I'm I missing something?

The0z avatar Feb 10 '21 21:02 The0z

same for me but it seem that if i set typeAnimated and animateFromElement to false it is fixed

Thank you @vlad1m1r. It worked

khanhubgit avatar May 23 '21 06:05 khanhubgit