primeng icon indicating copy to clipboard operation
primeng copied to clipboard

sidebar below toolbar. appendTo has no effect.

Open ABSTRACT123 opened this issue 5 years ago • 4 comments

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.

ABSTRACT123 avatar Jun 24 '21 22:06 ABSTRACT123

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>

snekku-dev avatar Nov 18 '21 14:11 snekku-dev

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) image image From my opinion it should work automatically when appendTo different from body. In addition, could you add option to push content inside the parent?

adcore-dev avatar Apr 22 '22 13:04 adcore-dev

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,

cetincakiroglu avatar Nov 09 '22 14:11 cetincakiroglu

Looks like it work now. Do you have an idea how to push content inside the parent?

adcore-dev avatar Nov 09 '22 18:11 adcore-dev