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

Paginator: Responsive paginator shows all variations at same time instead of at each breakpoint #6595

Closed
daveraynor opened this issue Oct 17, 2024 · 1 comment
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@daveraynor
Copy link

Describe the bug

The paginator component's responsive functionality isn't working. It shows all variations stacked instead of when resizing window.

You can go to the stackblitz link from the code examples in the primvue documentation

Screenshot 2024-10-17 at 11 12 10 AM

Reproducer

https://stackblitz.com/edit/primevue-4-vite-issue-template-8fevuq?file=src%2FApp.vue,src%2Fmain.js

PrimeVue version

4.1.1

Vue version

4.x

Language

TypeScript

Build / Runtime

Vue CLI App

Browser(s)

chrome, safari, firefox

Steps to reproduce the behavior

No response

Expected behavior

Expecting paginator to display the single component that shows each variation at different screen sizes instead of all variants stacked on the same page.

@daveraynor daveraynor added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Oct 17, 2024
@CCodam
Copy link

CCodam commented Oct 17, 2024

This is due to the stylesheets being added in the wrong order. The highlighted one should be after the other two.
image

I'm not sure how we accomplish that. Maybe we need to wait for nextTick before calling or within the createStyle function?

Also, unrelated to this specific issue, there is syntax error in the css being generated. The "," needs to be replaced with a "{"

.p-paginator[${this.$attrSelector}],

  • We ref the Paginator component
  • We call the createStyle() method at onMounted
<template>
<div class="card">
    <Paginator
        ref="comPaginator"
        :template="{
            '640px': 'PrevPageLink CurrentPageReport NextPageLink',
            '960px': 'FirstPageLink PrevPageLink CurrentPageReport NextPageLink LastPageLink',
            '1300px': 'FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink',
            default: 'FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink JumpToPageDropdown JumpToPageInput'
        }"
        :rows="10"
        :totalRecords="120">
    </Paginator>
</div>
</template>

<script setup>
import { ref, onMounted } from 'vue';

const comPaginator = ref();

onMounted(() => {
    comPaginator.value.createStyle();
});
</script>

@tugcekucukoglu tugcekucukoglu added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Oct 24, 2024
@tugcekucukoglu tugcekucukoglu self-assigned this Oct 24, 2024
@tugcekucukoglu tugcekucukoglu added this to the 4.2.0 milestone Oct 24, 2024
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
Projects
None yet
Development

No branches or pull requests

3 participants