-
Notifications
You must be signed in to change notification settings - Fork 6.7k
collapse plugin renders a rising scrollbar on bootstrap navbar #5474
Comments
ng-include is an anti-pattern - there is no good use case for it. Not able to reproduce this - what OS/browser are you seeing this on? |
DIdn't know ng-include was an anti-pattern. That's how the angular-fullstack generator sets up the nav bar component. I am on Win 7 and am able to repro in FF 44.0.2 and Chrome 48.0.2564.109 m After expanding the right panel in the plunker to show the uncollapsed nav, the preview must be refreshed using the Refresh button in the plunker |
I tried it with a directive and the behavior is similar to ng-include. When the directive is in the top-level page, the navbar displays fine but when the navbar directive is in a view, then the issue occurs. Plunkr with a directive: https://plnkr.co/edit/MnGQHgXW8pod42xexkkp?p=preview I've reproduced all 3 scenarios in this plunker |
+1 - I have got the same problem with the horizontal scrollbar. |
+1 - I have got the same problem with the horizontal scrollbar. |
im using ng-include too, i thought it was because of collapse. but when i patch the collapse with earlier version the scroll when changing page / refresh doesnt disappear. |
+1 - Encountering this issue as well |
The problem is when navbar open and close at the same moment. |
Best example for new version!) |
Encountering this as well. Kolkov's suggestion to initialize the |
@kolkov in this link the navbar isn't with angular-animate. |
i'm with the same problem, if I add angular-animate the scrollbar appear without angular-animate it desapear. |
woooooowww, I think a solution, if I put the css class in my code, working for me |
I've been struggling with this same issue for ages. I can't seem to figure out a working solution. |
is there any example of this solution used. |
Im still having this problem even after using that css class |
@wesleycho The plunker still shows the scrollbar issue after changing the angular-ui-bootstrap version to 2.1.3. Using the second link above: https://plnkr.co/edit/MnGQHgXW8pod42xexkkp?p=preview |
it would be best if somebody puts up working example of the solution before closing the issue |
I also still see this issue with the latest version of angular bootstrap ui |
Please somebody who has solved this issue put up a an updated Plunker example. |
@jadir-junior could you provide example of working example |
@wesleycho This issue was introduced by commit 533a9f0 which switched to using The Angular docs for $watch have this to say
|
@stevebread did you solve it? |
@Rafi993 I can get it to work by patching collapse.js but I'd rather have an official fix. If you are ok to patch it locally, replace this line in scope.$watch(attrs.uibCollapse, function(shouldCollapse) { with scope.$watch(attrs.uibCollapse, function(shouldCollapse, shouldCollapseOldValue) {
if(shouldCollapse === shouldCollapseOldValue) return; |
I had to look into this some more because I realized that collapse() is not being called twice, the page I was testing with had a second collapsible component in addition to the menu and that's why I was seeing 2 calls. The above fix still works for the navbar but the second collapsible component displays open even though So what's needed then is that if a component is collapsed by default it should have the correct markup i.e. if |
Meanwhile this issue is really fixed, this piece of CSS could be a workaround:
|
then please post a working plunker example @MohsenEkhtiari |
Sure, |
thanks @MohsenEkhtiari |
@MohsenEkhtiari Your fix didn't work for me. I had to use
|
@jonaszuberbuehler I have this scrollbar problem when navbar is opening not when it is collapsing or collapsed. Could you provide a plunker case which needs your fix? |
@MohsenEkhtiari Yes, https://plnkr.co/edit/6TJ4socmsTRicOVoAJUJ?p=preview. I know, ng-include is considered an anti-pattern and should be replaced. But I suppose the code in the plunkr should work. |
@MohsenEkhtiari Still can see the horizontal scrollbar (latest Chrome on Ubuntu 15.10) |
Did the trick for us. |
Plunker: https://plnkr.co/edit/2H4yZfl6zSM0WmVzaba8?p=preview
Make sure the right panel is wide enough so that the navbar does not collapse and you will see a horizontal scrollbar (on initial load / refresh) that floats upwards starting from the bottom of the navbar.
The scrollbar does not appear if the navbar content is added to the file directly instead of using ng-include.
Removing the navbar-right content makes the scrollbar appear to go away but an element is still floating upward which can be detected as it passes over the 'Left' text.
Found this while upgrading from 0.13.4. It was introduced in 0.14.0.
(Edit: changed plunker URL to go straight to preview)
(Edit: mention that this comment is related to ng-include)
The text was updated successfully, but these errors were encountered: