-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Position issue inside absolute scrolling container #1422
Comments
Hrmmm...the 3rd issue does sound like a bug. For the second issue, you can set $('.my-container').scroll(function() {
$(window).trigger('scroll');
}); to allow the menu to resize as you scroll. |
This is indeed a nice workaround ;) However, I'm not sure about how it would integrate in my app since several plugins are listening to the scoll event. Maybe I'll give it a try. |
Hi, |
I think this is a normal behaviour. My page is quite unusual, and the library doesn't know where it should stop the menu. How would you detect that In bootstrap-select, as well as in bootstrap itself for some js components, there is a |
Thank you very much you confirm my guess. |
Hi, did you fix the third issue? I am having a similar problem and I have found no way to fix it. |
OK, I asked (and posted a JSFiddle) here |
Hi, |
Uhhhh too bad :( |
Answered here: http://stackoverflow.com/a/38722336/2663813 In short: Your issue demonstrated in your jsfiddle (https://jsfiddle.net/f7f7fpab/) is the same as mine, but for another use case. The bugfix for this issue should resolve both. |
Hi @caseyjhol Thanks for the fix! This indeed solves the issue, but for a multi-select list I still have an error:
In this code:
I did not have this error before. Watching the commit diff it looks related to your last commit, right? Anyway, let me know if you would need a reproducible test case, as it would take me some time. If it is clear enough, then better. Thanks in advance and thank you for this great tool |
@marianopeck That should be fixed now. The semicolon didn't get changed to a comma. |
Hi @caseyjhol Thanks for your answer. However...if I change the semicolon to a comma as you did in your commit, then I do not have the JS error, but the menu goes back to be misplaced (when using |
BTW...is there a way I can point the JSFiddle to use the latest commit from github? If true, I can update this one which is failing now: https://jsfiddle.net/f7f7fpab/4/ |
Please give it another try now. scrollTop was being added twice if the container was |
Hi @caseyjhol I continue trying but I am still finding problems :( I have updated my JSFiddle to point you latest JS and CSS from github master to ease testing. You can see in the JSFiddle below, how the "state" field is misplaced below. And I cannot even close the popup list :( https://jsfiddle.net/f7f7fpab/6/ Thanks in advance, |
@marianopeck You're not loading the Bootstrap JS on that Fiddle. Adding it appears to make it work. |
HI @caseyjhol Sorry, I accidently removed Bootstrap JS when adding the latest Bootstrap-select. Anyway, I just added and I can still reproduce it. I forgot to say that you must put the "State" field on top of the screen to force a |
Ok - now it should be working for you. The issue was |
Hi @caseyjhol Thanks! That indeed solved my issue. Thank you very much. Now I have another scenario failing but this is trickier to test. Basically, when I use I created a JSFiddle. That exact code reproduced the problem inside my app, but obviously in JSFiddle it does not work as the AJAX call fails..so the ajax call fails and it does not do the https://jsfiddle.net/7s3mv7ov/1/ Any idea what could have changed in this regard? Thanks a lot in advance |
Hi @caseyjhol , |
@jeremyVignelles The third case should now be fixed in the latest master. |
Indeed! https://jsfiddle.net/up7t3y3q/6/ |
Hi @caseyjhol No clue about mine? I want to put all your fixes into my production app, but the mentioned above ajax problem is preventing me from doing so :( |
@marianopeck Can you provide a working example? Perhaps substitute setTimeout to simulate the AJAX request. Hard to see what's going on without getting a better look at your code. |
Hi @caseyjhol I tried to isolate the usecase with
For 2) , I think I can solve it with Any clues or advice? |
Hi @caseyjhol OK, I make some progress and I am trying to integrate all your latest changes into my app for my final real testing. The problem is that I still cannot make the |
…nt dimensions than body) fix snapappointments#1422
I am using select-picker in a page where I have a navbar and a main area which is in
position:absolute
andoverflow-y:auto
.When I use a select picker with a long list of items, the select is positioned outside my main area, which make it appear as if it was under my navbar.
See this fiddle: https://jsfiddle.net/up7t3y3q/1/
Steps to reproduce:
resize the "run" area in jsfiddle so that there is not enough space for the selects to drop down.
Open the first select-picker, it will drop up, but is cropped.
Open the second (
data-container="body"
) : it is correctly placed and can go over the navbar. Try to scroll : The picker does not followOpen the third (
data-container=".my-container"
) : incorrectly placed. Its position seems to depend on the scroll.What I expect:
I'm ok with the first two behaviors, this is by-design. Limiting the height of the
dropdown-menu
to the height available inside the closest item having anoverflow
css property could be rather complex.The third behavior however seems to be a bug for me, as the
.dropdown-menu
placement is completely wrong. Would you like me to make a PR?The text was updated successfully, but these errors were encountered: