Skip to content
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

Sidebar content overflows its container #1175

Closed
glebgolov-ziosem opened this issue Apr 13, 2021 · 1 comment
Closed

Sidebar content overflows its container #1175

glebgolov-ziosem opened this issue Apr 13, 2021 · 1 comment
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working vue2-portable
Milestone

Comments

@glebgolov-ziosem
Copy link

glebgolov-ziosem commented Apr 13, 2021

"primevue": "^3.3.5",
"primeflex": "^2.0.0",
"vue": "^3.0.0"

As per title, I've seen that the content of the sidebar overflows without any scrollbar showing up. I don't know if it's wanted as it is now in PrimeVue, I've seen the new Offcanvas component of Bootstrap 5 behaving in a different way. Down below I share a little styling to resolve the issue.

A few images explain more than 1000 words (I hope)

Simple sidebar

Screenshot_20210413_121358

Simple sidebar content

Screenshot_20210413_121221

A bit more complex example (with TabView and TabPanel(s))

Screenshot_20210413_121558

My solution for the TabView case (third image)

For the TabPanel that contains a lot of content I've written:

<TabPanel>
    <template #header>
        <i class="pi pi-fw pi-user"></i>
        <span>Informazioni</span>
    </template>
    <div class="p-inputtext-sm p-mt-3 p-px-2" style="height: calc(100vh - 200px); overflow-y: auto">
        <div class="p-fluid p-formgrid p-grid">
            ...
        </div>
        <Divider class="p-mt-0" />
        <div class="p-fluid p-formgrid p-grid">
            ...
        </div>
        <Divider class="p-mt-0" />
        <div class="p-fluid p-formgrid p-grid">
            ...
        </div>
    </div>
</TabPanel>

where style="height: calc(100vh - 200px); overflow-y: auto" is added to make it work and the class p-px-2 (primeflex needed) to compensate the width taken by the scroll bar. In this case 200px in the height calculation are ok but it is possible to change to your liking.

If you want to use the ScrollPanel component instead, it is possible to replace the uppermost div in the TabPanel with a little more concise <ScrollPanel class="p-inputtext-sm p-mt-3" style="height: calc(100vh - 200px)">

@tugcekucukoglu tugcekucukoglu added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working vue2-portable labels Apr 19, 2021
@tugcekucukoglu tugcekucukoglu added this to the 3.5.0 milestone Apr 19, 2021
@tugcekucukoglu tugcekucukoglu self-assigned this Apr 19, 2021
@tugcekucukoglu
Copy link
Member

Thanks for your report. It is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working vue2-portable
Projects
None yet
Development

No branches or pull requests

4 participants