-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
[bug] centerHorizontalOnly plus an animated button caused showDialog promise never resolved. #229
Comments
I can confirm this. I don't have animated button, but setting centerHorizontalOnly to true, then the dialog is never resolved. |
I went trough the code and the only difference is that this function is not called:
So I configured a position function: config.settings.position... that uses the exact same function. But when you remove this line (ofc not using 'vh' in the code after):
the dialog is not resolved. I just can't understand why. |
I confirm I have the same problem. setting centerHorizontalOnly to true makes the promise never resolve. |
While trying to bypass this problem, I tried to replace the 'centerHorizontalOnly' setting with a 'position' callback setting. This triggered the same problem... By the way, I need to override the vertical centering because I'm displaying a dialog with a compose element inside that is populated from a server query. This means (as far as I understand it) that the dialog content is empty when the dialog's position is calculated so it is position with its top at the center of the screen and when populated, the dialog extends beyond the bottom of the screen. |
@gama410 Did you try setting |
@StrahilKazlachev as the default value of this settings is 'false', I guess you meant to set it to true? |
Boostrap doesn't use native transitionend event, but rather simulated it with setTimeout for reliable callback. from https://github.com/twbs/bootstrap/blob/master/js/transition.js#L35-L43 // http://blog.alexmaccaw.com/css-transitions
$.fn.emulateTransitionEnd = function (duration) {
var called = false
var $el = this
$(this).one('bsTransitionEnd', function () { called = true })
var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
setTimeout(callback, duration)
return this
} Quote from the linked article by ALEX MACCAW:
@StrahilKazlachev @PWKad how do you think about if (ignore || !hasTransition(this.dialogContainer)) {
resolve();
} else {
// this.dialogContainer.addEventListener(eventName, onTransitionEnd);
setTimeout(resolve, TRANSITION_DURATION); // 200ms
} The down side is now I need to use TRANSITION_DURATION to build defaultCSSText. |
How did this happen?? I don't think I got the privilege for doing that. |
I'll refrain from promising specific dates, but soon I'll merge the |
Great to hear. |
I'm submitting a bug report
1.0.0-beta.3.0.1
Please tell us about your environment:
Operating System:
OSX 10.x
Browser:
Chrome Latest| Firefox Latest | Safari Latest
Chrome and Firefox hit the bug every time.
Safari is less affected, with a small chance to hit the bug.
ESNext
Current behavior:
on top of position bug #190 , an button with transition css caused showDialog promise never returned.
Expected/desired behavior:
See the example here https://github.com/huochunpeng/dialog-bug
It's an aurelia-cli project.
BTW, please provide a public bundle of aurelia including aurelia-dialog for easy gist creating.
What is the expected behavior?
Just make it work.
What is the motivation / use case for changing the behavior?
The text was updated successfully, but these errors were encountered: