sidebar below toolbar. appendTo has no effect.
Hello,
I tried to have a sidebar appear below the toolbar but couldn't. I did many tries with no luck. I posted on the forum where, in reply, PhilHuhn suggested to raise an issue. Here is below the code he wrote to test the case.
https://stackblitz.com/edit/primeng-sidebar-demo-forum-abstract?file=src/app/app.component.html
I usually see the sidebar implemented within a container (Angular Material, .Net, ...). The container holds the sidebar and the content, which also allows for interaction between the sidebar and the content (push, side, overlay, ...).
It is then easy to put the container where ever one needs and also to manage the remaining space according to different options (like visual studio does for instance).
Thank you.
The workaround I found for this would be to wrap the sidebar with the container , style the container with position:relative and finally style the side bar with position:absolute.
<div [style]="{position: 'relative'}">
... Content ...
<p-sidebar [style]="{position: 'absolute'}"></p-sidebar>
</div>
If you don't want to write the sidebar inside the container you can use the appendTo property and reference the container
<div #container [style]="{position: 'relative'}">
... Content ...
</div>
<p-sidebar [appendTo]="container" [style]="{position: 'absolute'}"></p-sidebar>
The workaround I found for this would be to wrap the sidebar with the container , style the container with position:relative and finally style the side bar with position:absolute.
<div [style]="{position: 'relative'}"> ... Content ... <p-sidebar [style]="{position: 'absolute'}"></p-sidebar> </div>If you don't want to write the sidebar inside the container you can use the appendTo property and reference the container
<div #container [style]="{position: 'relative'}"> ... Content ... </div> <p-sidebar [appendTo]="container" [style]="{position: 'absolute'}"></p-sidebar>
It still start animation from defined position in sidebar (top in screenshots)
From my opinion it should work automatically when appendTo different from body.
In addition, could you add option to push content inside the parent?
Hi,
So sorry for the delayed response! Improvements have been made to many components recently, both in terms of performance and enhancement. Therefore, this improvement may have been developed in another issue ticket without realizing it. You can check this in the documentation. If there is no improvement on this, can you reopen the issue so we can include it in our roadmap? Please don't forget to add your feedback as a comment after reopening the issue. These will be taken into account by us and will contribute to the development of this feature. Thanks a lot for your understanding!
Best Regards,
Looks like it work now. Do you have an idea how to push content inside the parent?