"make sure sidebar and pusher are direct children of your body tag". They do #2130
-
Everytime I run my application I have the following errors in the console: Sidebar: Had to add pusher element. For optimal performance make sure body content is inside a pusher element Sidebar: Had to move sidebar. For optimal performance make sure sidebar and pusher are direct children of your body tag <div class="ui vertical sidebar borderless menu left" id="main-sidebar">… Having a look a the source I have this: So, what could be wrong with my code? |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 1 reply
-
Do you happen to initialize the sidebar with a different Otherwise your HTML looks fine, please provide a jsfiddle including your JS code for easier investigation. |
Beta Was this translation helpful? Give feedback.
-
Sorry, it is hard for me replicate it using jsfiddle, since I'm using sidebar in my Angular app.
Here is the globar header code in which I do it:
Is this initialization setting a different |
Beta Was this translation helpful? Give feedback.
-
I will try to have a reproducible example. In the meanwhile here is how the DOM changes before I open the sidebar and after I pressed the toggle button. Could you get any hint from this? |
Beta Was this translation helpful? Give feedback.
-
Maybe I have a working Angular reproducible example: https://stackblitz.com/edit/angular-uszhcl Please have a look at it. |
Beta Was this translation helpful? Give feedback.
-
@smartm0use Thanks for the example, which i fixed for you here: Two issues were fixed:
|
Beta Was this translation helpful? Give feedback.
-
In Angular I have to go for components, so for a component I can't use So, I can't fix it :( Maybe I could set |
Beta Was this translation helpful? Give feedback.
-
You can initiate the sidebar with config settings, then attach your events $('#main-sidebar')['sidebar']({
silent: true
});
$('#main-sidebar')['sidebar']('attach events', '.toc.item'); See https://stackblitz.com/edit/angular-gbha7b?file=src%2Fapp%2Fapp.component.ts |
Beta Was this translation helpful? Give feedback.
You can initiate the sidebar with config settings, then attach your events
See https://stackblitz.com/edit/angular-gbha7b?file=src%2Fapp%2Fapp.component.ts