-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Modal: Bad position on second show #614
Comments
I can't reproduce any issues from modal docs related to positioning. Can you make a jsfiddle? |
OTR I sent you private demo on your email. |
Same problem as you. |
Same problem for me |
This isnt occurring for me in Chrome/Safari/FF. Can someone give me their exact browser version and OS who can see this issue? |
OS: Microsoft Windows 7 HP (build 7601, Service Pack 1, latest updates) |
I'm seeing this in chrome as well on windows 7. This is a bug will fix ASAP |
❤️ |
Having same issue, ff/chrome/opera @ ubuntu 14.04 b2 |
It looks like having a set height on the modal fixes this issue for me |
same here problem is solved by setting explicit height of modal... |
bug is still reproduced |
Thanks, could anyone create a JSFiddle that will reproduce the issue? This might be related to having a parent with a 3D acceleration trigger like |
@jlukic |
I'm using FF 28, Windows 8 and cannot reproduce the error using your JSFiddle. Am I missing something? |
My problem was caused by .hidden with !important as well. +1 P.S. Linux ff latest stable, chromium latest stable |
@jlukic |
It looks like modals were rebuilding cached sizes on every show instead of just on browser resize. Bad! I've also fixed modals to work with css that has a rule like |
I have the problem with wrong position on 2+ show. Windows 8 |
@kwolniak Are you having this problem on the docs page or just your site? Can you provide a test-case for this error with latest SUI? |
@jlukic One the docs page all examples works fine. Click one the red "WYCOFAJ" button in the table row (column "Akcja"). |
Had same issue, only with "basic" modal though. |
+1 |
How about the image loaded in modal? |
Thanks @speciose and thanks @Kyezil, your solutions work! |
The solution from @speciose and @Kyezil works for me. Thanks! |
For me this issue happens when I set detachable:true. I looked into the code and the problem is when detachable=true, on the second show the modal content height is evaluated on a hidden element (too soon) and evaluates to 0, which is wrong. As a workaround I used the following:
|
None of these fixes are working for me. I have a long form that extends past the page. All works fine, until I have scrolled down and press submit. Upon pressing submit, the modal jumps down and has a huge top margin and is cut off at the bottom of the screen. (Because of a error messages div opening up with a list of all the form invalidation) trying the |
doubled (2nd delayed for 100ms) refresh does recenter the Modal - but does not look nice :/ |
so in my case despite doing
Although after doing some CSS comparisons with the examples in the docs, I found that the only difference and what was causing this is some file that just does not exist and isn't mine in http://localhost:8080/scss/_modal.scss which is applying this css to the modal
Any ideas why this is ? |
@dubsky 's solution can fix the similar problem |
OP's workaround (setting timeout onShow) was the only thing that worked for me (tried all the workarounds posted on this issue). |
My observation: So my solution is deleting and re-creating whole element rather than replacing its content. If your environment is similar of mine, it's solid solution. BTW: add a little delay between creating element and calling it. |
@fuatsengul bingo.
|
hey guys, I meet the same problem on "semantic-ui#^2.1.8", I replaced two css defines in my custom css file(because the whole semantic-ui in my .gitignore), and it works fine for me: |
This is still a bug, modal opens at different position when opened second time. |
setTimeout works for me. Is this problem due to the positioning taking place before the modal has fully loaded? |
I'm using Semantic UI with Ember and having the same issue. I've tried all the fixes detailed here and I'm not really having any luck. setTimeout works, but over a slow connection this can be unpredictable. |
@mklnz ... I ended up loosing the modal ... I tried the following but it caused more problems further down the line. It goes through any div's inside the modal, calculates their individual height and changes the height of the modal.
If you are having problems over slow connections use the 'onVisible' call back? |
I have the same problem. Also in second time there is no scrolling class on dimmer element. |
After digging around I find the problem with my case is Ember inserts and updates the DOM dynamically, and inserts an image inside the modal div. However, this image has not started loading yet, hence the overall height of the modal container is 0. Semantic then calculates this as 0 and then shows the modal as margin-top of 0 (calculated). Only after the image actually loads the container has a height, in which case the centering is now incorrect. I suppose I can find some way to "preload" the image perhaps, before showing the modal? |
Entire Semantic-UI framework is fucked up with lots of bugs, the toggle switch does not work after opening & closing modal. I am switching back to bootstrap. |
Thank you @kwolniak and @fuatsengul ... the combination of your discoveries solved my problem. $('#modal').modal(
'setting', {
observeChanges: true,
// other params here
}
); |
Mine issue was the modal disappears in two seconds, and the content needs to be read. solved it by using the tag instead of the tag I used, though class remain same as ui button. |
.modal{ I dont know how but this solution worked for me. I have 3 modal closing and opening after another. and they are in a loop. |
Is there a solid workaround for this yet? I'm getting the same issue. On first open, it's perfectly centered on the screen. On second open, It's positioned at the top of the screen. I've tried recommendations here but no luck :/ |
My solution was to brute force the css ie $(“#modal”).attr(“style”, “top: 10px”); So I replace the inline styles put in by Semantic UI with my own positioning. In my personal case, it hasn’t broken anything else and seems to be consistently working. I also don’t need it to follow an element but just to show up in full-screen mode in the same position on each open so this works fine for me. Hope this helps! |
Thanks for that. Unfortunately I went ahead and made a reusable modal :/ Not as good as semantic but what can you do? |
Hello, I have this issue too, but only in Firefox. For my project, I have fixed it by scrolling the dimmer to 0 :
|
I solved it, |
When modal showed for second time it "falls" half bellow screen.
My uneducated guess is position is computed and set only first time when modal is shown and second time default CSS makes it fall.
Modal includes some generated items by KnockoutJS but items are not added between shows.
The text was updated successfully, but these errors were encountered: