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

Carousel: page attribute not updating carousel #4684

Closed
autoboxer opened this issue Oct 24, 2023 · 5 comments · Fixed by #4685
Closed

Carousel: page attribute not updating carousel #4684

autoboxer opened this issue Oct 24, 2023 · 5 comments · Fixed by #4685
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@autoboxer
Copy link
Contributor

Describe the bug

description

The page attribute isn't updating which page of carousel items are in view. Dynamically changing the page value updates indicators and left/right navigation correctly, however, the carousel items themselves don't shift to show the correct page.

It looks like internally the Carousel component makes a call to navForward() or navBackward() when the selected page index changes. Without those functions exposed or page updates working, there's no way for actions external to the Carousel or its controls to update what page of items are shown.

related issues

e.g. Carousel Component: add Methods like navForward() to Public API

Reproducer

https://codesandbox.io/p/sandbox/morning-meadow-3j8xll?file=%2Fsrc%2FApp.vue%3A1%2C1

PrimeVue version

3.34.0

Vue version

3.x

Language

ALL

Build / Runtime

Vite

Browser(s)

Chrome 118

Steps to reproduce the behavior

  1. go to https://codesandbox.io/p/sandbox/morning-meadow-3j8xll?file=%2Fsrc%2FApp.vue%3A1%2C1
  2. click on the page +1 button - note the controls and in view carousel page updates
  3. click on the page -1 button - note that the controls update, but the page in view does not
  4. from this point on, all adjustments to the page value will update the carousel controls, but not the visible page

Expected behavior

updating the value that gets passed into the page carousel attribute should update both the page in view, as well as the carousel controls (assuming the passed in value is a valid page index).

@autoboxer autoboxer 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 24, 2023
@autoboxer
Copy link
Contributor Author

autoboxer commented Oct 24, 2023

I'm working on a PR for this and should have something working shortly.

@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 25, 2023
@tugcekucukoglu tugcekucukoglu added this to the 3.38.0 milestone Oct 25, 2023
@ostrui
Copy link

ostrui commented Jun 5, 2024

I still have this bug on "primevue": "^3.20.0",

@dimaskurniawan0804
Copy link

I still have this bug on "primevue": "^3.37.0",

@mzhadigerov
Copy link

mzhadigerov commented Nov 15, 2024

Doesn't work with images.

@mzhadigerov
Copy link

mzhadigerov commented Nov 15, 2024

Nevermind it worked. My carousel was wrapped with v-if. After changing it to v-show it worked.

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

Successfully merging a pull request may close this issue.

5 participants